Category Archives: internet

Protect your WordPress contents from plagiarism with a digital timestamp

Since a while ago, I decided to release all the contents I produce with a Creative Commons license. Why? Well, once I publish my stuff online, anyone with an internet connection can read it; so, if they like it and want to make it more widely available, a stricter copyright policy would compell them to ask me for permission and blah blah; if people like the contents I produce and distribute them around, I’m happy about it, as long as it’s made clear that I am the original author and noone else tries to take credit for my work (because that would obviously piss me off big time). The CC license I chose is the NC-SA, which also forbids any commercial use of my contents (if someone’s going to earn money out of my work, then I want my fair share), and allows re-use of the contents as long as they are released with the same license (I wouldn’t want someone to take my work, reassemble it at his own liking, and then lock it down even if it’s not really theirs).

Well, all’s good until now, but what if someone tries to “steal” your contents? The things you write are legally yours since the moment they are written (as long as they are original, naturally), yet you need to prove they’re yours in case of a dispute. If someone copies one or more articles off your website, he could very well decide to say that those contents are his, and you copied them off him; your word against his.

The only way to “prove” that a written text is yours, is to prove that it was in your possession before anyone else got it; “timestamping” is the keyword, a timestamp which is legally valid (meaning that noone would be able to prove it’s fake), and that binds the digital works with your identity; it’s best if you get a digital timestamp before releasing your work, in fact, if an “attacker” has the means to download the contents off your website and certify them before you do, he would become the new technical owner of your contents.

There are several ways to get a timestamp, free and paid, more and less solid. A free digital timestamp service is provided by Timemarker, but it’s only available for manual timestamping, that is you have to go to their site and provide them with your contents, then download their timestamp PGP signature. It’s good if you need to timestamp images, or archives.

On the other side, if the contents you want to timestamp are written posts on your WordPress blog (and this is all this article is about), the only real good service available to occasional bloggers like me (those who do not make a living with their website) is the free Copyright Proof WordPress Plugin (wordpress.org plugin repository has the most updated changelog), which gets you the best for its price. As soon as you register a free account on Digiprove (they also offer paid timestamping for professional, non-Wordpress users), you can insert your own API key in the plugin, and it will take care of everything: as soon as you hit the publish button in the WordPress editor, before actually publishing the article its written contents will be submitted to Digiprove server for secure timestamping, and once the timestamp information is obtained, the article will be online along with its certificate (you can control how the digiprove timestamp appears both on your website and on their servers, and you can also see the badge at the bottom of this post). Same thing happens when you edit the article, the certificate will be updated to reflect the changes on the article, and the older certificates, even if not linked anymore, will still be valid for the previous revisions of the article.

This service, again, is free, and does its job perfectly. Cian Kinsella, Digiprove’s CEO, told me they’re going to improve the way the plugin works, to make it dynamically create the certificate HTML code inside the post (it’s currently hardcoded, with CSS styling done inside the tags), and he also anticipated that, after this change has been done, they will be probably adding a feature I requested, that is a sort of “older certificates drawer”, thanks to which the reader can access the links to the older timestamps of the previous revisions of your page which reside on their servers, and are currently lost (the links, not the certificates); this will greatly improve the functionality of the plugin for those who prefer updating their older posts with newer info, instead of opening new posts.
By the way, even if Cian is CEO of two different companies, and I don’t know his daily schedule but I suppose it should be pretty busy, he still managed to personally reply to my mails to Digiprove’s support, which is good!

Since a while ago, I decided to release all the contents I produce with a Creative Commons license. Why? Well, once I publish my stuff online, anyone with an internet connection can read it; so, if they like it and want to make it more widely available, a stricter copyright policy would compell them to ask me for permission and blah blah; if people like the contents I produce and distribute them around, I’m happy about it, as long as it’s made clear that I am the original author and noone else tries to take credit for my work (because that would obviously piss me off big time). The CC license I chose is the NC-SA, which also forbids any commercial use of my contents (if someone’s going to earn money out of my work, then I want my fair share), and allows re-use of the contents as long as they are released with the same license (I wouldn’t want someone to take my work, reassemble it at his own liking, and then lock it down even if it’s not really theirs).

Well, all’s good until now, but what if someone tries to “steal” your contents? The things you write are legally yours from the moment they are written (as long as they are original, naturally), yet you need to prove they’re yours in case of a dispute. If someone copies one or more articles off your website, he could very well decide to say that those contents are his, and you copied them off him; your word against his.

The only way to “prove” that a written text is yours, is to prove that it was in your possession before anyone else got it; “timestamping” is the keyword, a timestamp which is legally valid (meaning that noone would be able to prove it’s fake), and that binds the digital works with your identity; it’s best if you get a digital timestamp before releasing your work, in fact, if an “attacker” has the means to download the contents off your website and certify them before you do, he would become the new technical owner of your contents.

There are several ways to get a timestamp, free and paid, more and less solid. A free digital timestamp service is provided by Timemarker, but it’s only available for manual timestamping, that is you have to go to their site and provide them with your contents, then download their timestamp signature. It’s good if you need to timestamp images, or archives.

On the other side, if the contents you want to timestamp are written posts on your WordPress blog (and this is all this article is about), the only real good service available to occasional bloggers like me (those who do not make a living with their website) is the free Copyright Proof WordPress Plugin (wordpress.org plugin repository has the most updated changelog), which gets you the best for its price. As soon as you register a free account on Digiprove (they also offer paid timestamping for professional, non-Wordpress users), you can insert your own API key in the plugin, and it will take care of everything: as soon as you hit the publish button in the WordPress editor, before actually publishing the article its written contents will be submitted to Digiprove server for secure timstamping, and once the timestamp information is obtained, the article will be online along with its certificate (you can control how the digiprove timestamp appears both on your website and on their servers, and you can also see the badge at the bottom of this post). Same thing happens when you edit the article, the certificate will be updated to reflect the changes on the article, and the older certificates, even if not linked anymore, will still be valid for the previous revisions of the article.

This service, again, is free, and does its job perfectly. Cian Kinsella, Digiprove’s CEO, told me they’re going to improve the way the plugin works, to make it dynamically create the certificate HTML code inside the post (it’s currently hardcoded, with CSS styling done inside the tags), and he also anticipated that, after this change has been done, they will be probably adding a feature I requested, that is a sort of “older certificates drawer”, thanks to which the reader can access the links to the older timestamps of the previous revisions of your page which reside on their servers, and are currently lost (the links, not the certificates); this will greatly improve the functionality of the plugin for those who prefer updating their older posts with newer info, instead of opening new posts.
By the way, even if Cian is CEO of two different companies, and I don’t know his daily schedule but I suppose it should be pretty busy, he still managed to personally reply to my mails to Digiprove’s support, which is good!

  This article has been Digiproved

Resize, enlarge or scale an html image map with a PHP script

I am creating a portal for an italian website which will sport a nice region selector with an imagemap, and region highlighting with a javascript. I found a free and detailed image map of italy along with a combined png, but it was too small to be really useable, so I needed to put a bigger image; with that, I also needed to alter the imagemap coordinates to they matched the enlarged image… noway I was going to do that by hand!

So, after searching for a pre-made solution (which I obviously didn’t find)  I devised a very simple PHP script to do eaxctly that. The script puts the entire code for the image map inside a string variable, and then processes that string with a regular expression search and replace to change the values accordingly to my needs. I only needed to make the image two times bigger, mantaining the aspect ratio, but since I was going to publish this inside a guide, I said to myself “why not making it so you can change the aspect ratio as well”. So, if you want, you can make the imagemap two times larger, and 1.5 times taller.

Here’s the sample script (the $html variable is defined with a sample imagemap for the region of Lazio alone, for space purposes, but you can put whatever you want inside, I used it with the whole map of Italy, together with <map> tags and lines breaks/indentation). Be careful and ESCAPE the double quotes inside the HTML before pasting the code inside the string. In other words, simply put a backslash (the \ character) before each occurence of a double quote (the $quot; character) inside the HTML, I used the search and replace function of Notepad++.

<?php
$html="<area href=\"#\" alt=\"state\" title=\"lazio\" shape=\"poly\" coords=\"74.513,86.938,75.667,87.365,75.667,88.007,74.744,89.077,75.436,90.467,76.359,90.039,77.857,90.039,78.319,90.039,79.127,90.788,79.588,91.857,79.588,92.606,80.049,93.034,80.51,93.034,81.317,94.103,81.779,94.852,82.24,94.959,83.74,94.852,84.201,94.959,85.123,94.959,86.392,94.103,87.43,93.141,88.122,93.141,89.39,93.141,89.967,92.713,91.351,90.895,91.813,90.895,92.274,91.216,93.196,90.895,94.349,90.788,94.926,90.467,96.31,89.825,96.886,90.467,96.656,90.895,95.849,91.323,95.387,92.072,94.234,92.072,92.965,92.713,92.505,93.676,92.505,94.317,92.734,94.959,91.928,95.28,91.813,95.922,91.467,96.778,92.505,98.382,92.505,99.023,92.505,99.986,91.928,101.804,91.928,103.194,92.734,103.837,94.234,103.623,96.31,104.264,97.579,105.013,99.309,106.51,102.191,108.543,103.229,108.543,104.728,109.077,106.113,110.361,106.574,111.965,106.804,113.035,106.574,113.783,106.574,114.425,105.882,114.853,105.305,115.067,104.844,115.067,104.728,116.029,104.728,117.099,104.152,118.061,103.46,118.703,102.999,119.345,102.999,120.093,101.961,120.308,100.23,120.735,99.539,120.308,98.271,119.345,96.656,118.489,95.156,118.275,92.965,118.489,91.005,118.703,89.39,116.885,89.506,116.029,88.122,114.639,85.931,113.997,83.97,112.607,81.548,110.574,78.55,107.687,77.627,105.869,76.128,104.692,74.975,102.874,73.706,101.056,71.745,99.023,70.131,97.098,67.594,94.959,69.093,93.676,70.131,92.606,70.592,91.216,70.592,90.039,71.745,89.611,72.553,88.649,73.014,88.221,72.553,86.938,73.245,86.189,74.513,86.938\" />";
echo preg_replace("/([0-9.]{2,}),([0-9.]{2,})/e","round(\\1*2,3).','.round(\\2*1.5,3)",htmlentities($html));
?>

All you need to do is change the parameters inside the regular expression (numbers in red), first is for horizontal proportion, second for vertical; in this example the imagemap will be resized to 2 times its length, and 1.5 times its height, if you want to make the size three times bigger, change it to

echo  preg_replace("/([0-9.]{2,}),([0-9.]{2,})/e","round(\\1*3,3).','.round(\\2*3,3)",htmlentities($html));

Then, copy the php script to your server, open it in a web browser, and copy/paste the result. Note: according the the way the imagemap is originally formatted, you may need to edit the regular expression to accomodate for spaces, tabs, linebreaks or whatever; in this case, since the coordinates were listed with just commas inbetween it was not needed. If you are stuck, write in the comments an excerpt of your imagemap code and I’ll try and help you.

  This article has been Digiproved

Time of last visit to a website page in Firefox history

Last time I put hands on my car, a Rover 75, in order to change by myself the in-tank fuel pump (maybe a tutorial will be coming about that), I already knew it was going to be a hard task. That’s why I made sure I had enough time, it was a sunny sunday morning and had plenty of light as well.

Last thing I did before going out in the yard was checking some tutorial page to rapidly review the job details, and first thing I did after the job was finally done and I checked the pump was working, was to call my girlfriend to give her the good news, even if I knew she wasn’t going to car much. What I hadn’t done, was checking the time before going out, and after getting back inside, and I was surely curious to know how much it had taken total.

Checking the call history on my phone was easy, so I knew the time I finished, but looking in Firefox History to see at what time I had last visited that tutorial webpage, it wasn’t as easy as I thought, since there was no right-click option whatsoever to obtain that info. I knew it had to be recorded somewhere, since Firefox has the capability of ordering its history based onorder of last visit, so a not-so-immediate search found this solution, whis is the following:

Go to History menu -> Show all history, then in that window you have to add the date column (right-click on the columns headers and check “Visit Date”), that will show the visited time.

If you’re curious, in the end I realized I had been a total of four hours at it.

Internet tools freeware downloads

After the website was moved to the new domain and converted to PHP, a lot of utilities linked here have been massively updated, disappeared, or become obsolete/useless. I removed the obsolete/useless ones, and added “google” near the ones which are not hosted in here but you should google for, while the downloads you can find in here are pretty rare, bust still useful ones

GuildFTP Daemon (GuildFTPd) (google)

Free FTP server, installs and configures easily, can interact with mIRC (great if you want to set a banner on an IRC channel to share songs, pictures, or everything else on your HD), has a nice graphic interface.

GuildFTP mIRC Script (google)

This mIRC script, younger brother of GuildFTPd, is an FTP server which runs in mIRC (!) through a script for this chat program. It is obviously usable only if you plan to run an FTP for an IRC channel, and should use less memory of the proper application, since is “embedded” in mIRC (obviously it’s not as user friendly as the main app).

NetPerSec (google)

ZDLabs utility to constantly monitor the download/upload speed. What is simply too cool about this one is that it shows itself in the system tray with a small graphic to see in real time the speed (too bad under Windows 2k it needs to be restarted if you disconnect/reconnect, because it behaves randomly…)

Zidrav (google)

You create a CRC table of the big file you downloaded, send it (via mail, IRC DCC, ICQ, whatever) to the guy who has the original file, who uses the same program and the CRC table you sent, to create a “patch”, which he later sends you (again, via FTP, DCC, or whatever), and which you use with the same program to fix your file which will be exactly the same of the original one.

How to get an named alias for your dynamic IP

No matter if you use a DHCP connection (which means you have a different IP address for each connection – every 56k and ISDN line, and some DSL and Cable lines) or a static IP one, if you have a server installed on your machine, you may take advantage by "changing" your IP with a named address (for example, "yournick.hn.org" instead of "151.21.7.103"); for instance, the users of your server would easily remember your address.

This can be done for free, using both a service which mantains a DNS (Domain Name Server – a server which is capable of telling you the IP corresponding to an alias, like "yournick.hn.org", that would correspond to "151.21.7.103" as in the example above), and a small program which checks your IP every "n" minutes, and if it changed since the last time, sends the updated information to the service itself. So, very briefly, someone who knows you have an FTP server responding, for example, at the address ilikecandies.hn.org, port 21, would have his FTP client asking to the DNS of the service to tell him your true IP, and then would directly connect to that IP… still the only information he must remember is "ilikecandies.hn.org", and not your true IP, which is much more difficult to keep in memory).

To the practice now: there are more than one way to achieve this, and they depend from the small program you use to send out your IP. Every free service suggests free utilities to update the IP automatically, and since I wrote this guide years ago, the only service still operating is DynDNS.org.

DynDNS allows you to choose aliases different from the principal domain (which means, you can get "yournick.dyndns.org", but also "yournick.mine.nu", "yournick.homeip.net", and several others).

How to install configure and manage an FTP server

2008 notice: up to date, the most complete and freeware FTP server is FileZilla. I do not have time, will, and resources to re-edit the whole guid to this software, anyway you can follow the same basic principles to setup a server

This is dedicated to all of you who would like to share with others their files, such as MP3’s, Movies, Pictures, FREE Programs, and… well whatever else you think it is a good idea to share .

Since there are many different FTP Server softwares out there, and as happened for FTP clients, some of them are free, I’ll put in here a tutorial on how to start from scratch with a free one (for instance WarFTPDaemon, which is, if not the most userfriendly, at least the most powerful; I’ll put available for download also GuildFTP, which instead is quite nice graphically, plus offers a very flexible interoperability with mIRC). Visit the Dowloads/Internet section of this site to get the installers.

 

Install and run the thing.

Let’s come to the tutorial itself.

This is how appears the server’s console when you start it. We’ll explain what to do step by step.

 

After the server is installed and running, we’ll have to set how many people can login, what port the server will be listening on, blah, blah, blah.

You have right now the chance to change the port the server will listen on, just put another number in place of 21 (the IP near the port can’t be changed, it logs your IP when you’re connected, and is 127.0.0.1 when you are offline). You can use virtually any numer, but avoid to use 23, 25, 80, 110, 139, which may (actually in very rare cases) interfere with your current other running services, and in general, choose with no problem any number from 1024 to about 65000. Then, the max decent number of users, unless you are on a T3, is 2 max for a 56k, even 3 for a 64k ISDN, 5-6 for a 128k ISDN, 8-10 for an aDSL, even a bit more for cable users. But still it’s your choice, the more users will connect at the same time, the slower they’ll go .

Next, you need to set users. One choice is to make an account for each person you want to access the server, asking them what username and password they prefer; or, if you, for example, serve songs in an IRC channel, it is much better to create a single account, with a standard username/password, like channelname/napstersux0rs (hey ’tis just and example ). Then you need to set the folders each user will be able to access, and what rights will have in those folders.

Reach the Edit User dialog by doing [Properties > Security > Edit User…]. You add users by pressing the Add button in the User panel side, then specifying a username (case sensitive), and a password (also case sensitive; you’ll be asked to retype it for security purposes; in this case, the login was ID:John PSW:Smith). Then switch to the File Access panel from the Security one. This is how you should set the (default permissions), that is, everything is disabled by default, you’ll specify for each folder if it is accessible or not.

 

And this is how you should set the parameters for the shared folders. To add a shared folder, press the Add button in the File Access panel side, and a dialog to choose the folders will appear. The Read right is to enable the download of the files. Uncheck the Write Delete Execute rights, to avoid l4m3 users from messing on your HD via FTP. The List (dir) right is to allow the user to see the folders he can access. Disable Create Remove to avoid a user from messing, as I told before. The Root and Home attributes are used to make the user automatically access the selected folder when he logins. If you want a login for each user, just keep adding them from scratch, till you feel you have enough accounts. When it is really all done, press the OK button in the upper right corner.

 

When you setted the user parameters, you need to adjust the overall server options, by doing [Properties > Options]. I won’t paste in here a screenshot for every panel, since you can follow the instructions by reading in here, and also because this page would get simply HUGE to download. So, you have the [Options > General] panel in front of you. I suggest you to enable Go online when started and minimize so the server, will be there ready to act. The rest if left to your will, only remember that selecting Advanced. Please enable all options you’ll find the Edit User panel a but more messy. Just use this option when you’ll become more acquainted with the program .

Switch to the Server Name panel (we can ignore for now all the other panels, which control the advanced options, and are not supposed to interest a first time user). In that panel, put a nice name for your server, like "FrAnKiE’s FrEe FoR AlL FiLeZ SeRvEr", and if you want insert your email, or leave the invalid default one.

This is done! I mean… almost… actually the two great capabilities of WarFTPd are folder mapping, and especially the Virtual File System. Since you can now start sharing your files, you can avoid reading further. But if you want to add more folders located on different disks/partitions (for example one with songs, another with pictures, another with programs and so on, and also a folder to let users upload files to you) it may be VERY useful to activate the disk mapping (I’ll avoid explaining how to use the Virtual File System, both because it should be used only by advanced users, and beacuse… err.. well… I still gotta fully understand how it works … but hey! I had to learn WarFTPd JUST to write down this tutorial!).

 

Now, let’s make an example: you have all your songs on the partition G:\, some pictures in F:\Docz\Images\…\, and want to add an Upload folder in F:\Temp\Uploads\ (well, this is more or less how my disk is organized, I suppose you don’t have so many partitions, but it will make the same, just change the example folders to the real names ).

Now, it would be a nice idea to create an empty folder just for the FTP (which will work actually only as a container for the links to the other, external, folders), let’s say F:\FTP\.

What will you have to do? Add the empty container folder in the File Access panel as I explained before. For this one, set the Read and List (dir) rights, plus the Recursive, Root and Home attributes. Then simply keep adding the other folders you want to share, selecting Read, List (dir), Recursive and Mapping.

When you select Mapping, the Alias dialog will appear, letting you specify the name which the folder will get when added to the Root of the Server. The G:\ folder will keep its current position, only there will be a link, named, suggestively, "Songs", which will appear as a folder inside F:\FTP, which, double clicked, will bring the user to G:\, as if it actually were F:\FTP\Songs. Kewl eh?

 

This is how you shoul set the Uploads folder. That is, activate the Write (file) and Create (folder) rights, to allow users organize their uploads in folders (for example, they can upload files in folders named after them, so you can know who sent you that file). The uploads folder will appear as "Upload Here" in the server root. Note: disable the Delete/Execute/Remove rights to avoid L4M3 users from deleting what others have uploaded to you. Also, you can disable the Read attribute, if you want to avoid users from downloading what others uploaded.

 

You can add as many folders as you want, building a very complex server.

 

Pheewww it’s done for real now.

 

Wait! Not yet! Do you want to know how to test yor server, even if you aren’t connected to the internet? Use an FTP client, and put all the data of the server (port, username and password), BUT use 127.0.0.1 as the IP. You will connect to your own computer, and see how the server works on the user-side.

A guide to FTP clients and to downloading files from FTP servers

Well, you gotta know the server details, first of all the IP address, or, if existing, the alias (something like “nick.dyndns.org” or “nick.cjb.net”). If the server is private, as often it is, you’ll have to know the port it’s listening to (the standard one is 21, but you may find 22, 23, 59, 92, and so on… with all the numbers from 1024 to 65000) and the UserID/Password (the “Login”). Important: usually both UserID and Password are case sensitive, and preserve spaces, so if the password is “Polly Wanna Cracker” you gotta use exactly “Polly Wanna Cracker” and not “pollywannacracker”!!!

And how do you connect?

You need an “FTP Client”. If you don’t have it, and want to find a free one, just search on www.google.com for “free ftp client”. 2008 notice: the author now uses, and suggests, FileZilla, a very good free ftp client

Suppose you are connecting… after some messages like:

[04.35.51] Connected to xxx.xxx.xxx.xxx Port xx
[04.35.52] 220 Server ready ...
[04.35.52] USER XXXXXX
[04.35.52] 331 Password required
[04.35.52] PASS (hidden)
[04.35.52] 230 User logged in.
[04.35.52] SYST
[04.35.53] 215 UNIX Type: L8

you’ll start receiving the Directory Listing, and will be able to browse as it was Windows Explorer.

To download a file, usually it is sufficient to drag from where they are, to the near window, which represents your Hard Disk, and then you may need to press a button like “Go”, “Start”, “Transfer”, or search an entry like those in the menus.

To close, I’ll add a tutorial, based on FlashFXP (if you have CuteFTP, you may try as well this one, which is undoubtedly better).

Let’s suppose the server is at the address someone.cjb.net (so [FTP > Quick Connect], write someone.cjb.net near “Server:”), port 53627 (write 53627 near “Port:”), UserID equal to your current nick on IRC (if you are Joe^74 write Joe^74 near “User Name:”), and password This is a joke (what will you write? This is a joke near “Password:”, it is clear, since I told you to maintain letter cases and spaces; not of course thisisajoke, otherwise you didn’t understand a fig, so scram).

Finished? Good, then just press “Connect” and you’ll start:

[04.35.51] Connected to someone.cjb.net Port 53627
[04.35.52] 220 Server ready ...
[04.35.52] USER Joe^74
[04.35.52] 331 Password required
[04.35.52] PASS (hidden)
[04.35.52] 230 User logged in.
[04.35.52] SYST
[04.35.53] 215 UNIX Type: L8

and it’s all done.

  This article has been Digiproved

mIRC script to check and show the pc uptime

Wouldn’t it be nice if just by issuing the command /uptime you could send to the window you have currently open a test like this?

This is what just appeared when I typed /uptime in my mIRC. Obviously my nick has been ripped off for privay reasons

 

It is much more complete than any simple uptime script which tells only your current uptime… I mean, it records you highest time!

Obviously, it requires scripting. Then, as usual, let’s see how the code works, and then let’s comment it.

Open your Aliases Panel, pressing the button, and add this code:

/checkuptime //if ($calc($ticks / 1000) > %UptimeRecord) //set %IlGiorno $asctime(d mmmm) | //if ($calc($ticks / 1000) > %UptimeRecord) //set %UptimeRecord $calc($ticks / 1000)

/uptime {
  //if ($calc($ticks / 1000) > %UptimeRecord) //set %UptimeRecord $calc($ticks / 1000)  
  //say 9,1 It is $day $+ , $time $+ , here in the Italian slumps, and 4Windows $os 9runned *cough*smoothly*cough* for8 $replace($duration($calc($ticks / 1000),2),wk,$chr(32) $+ Week,hr,$chr(32) $+ Hour,min,$chr(32) $+ Minute,day,$chr(32) $+ Day) $+ 9 $+ . Record:7 $replace($duration(%UptimeRecord,2),wk,$chr(32) $+ Week,hr,$chr(32) $+ Hour,min,$chr(32) $+ Minute,day,$chr(32) $+ Day) 9( $+ %IlGiorno $+ )
}

Now, we need to access the Remote Panel, by pressing the button, and add this line:

on 1:START:/timeruptime 0 40 /checkuptime   

or if you already have an on START in there, followed by { and some lines, insert "/timeruptime 0 40 /checkuptime" without quotes just before the } at the end.

You need to add a line also to the Variable Panel, accessible by reaching the Remote or Aliases Panels, and then clicking on the Variables tab. Here add this line:

%UptimeRecord 0

Now press OK and restart mIRC.

This script will check for you every 40 seconds if the current uptime is higher than the stored one, and if it is, updates the record, and stores also the current date. You can change the frequency the script checks the uptime by putting a different value in "/timeruptime 0 40 /checkuptime", for example use 60 instead of 40 if you want to check every minute.

Needless to say, you can, or better you must change the message as well, since as you can see it fits my being italian . Just write what you like, and format the colours and text attributes as you prefer.

This is all, type /uptime and press Enter to see the result.

mIRC script for custom quit messages

Maybe you didn’t know that by doing a simple /quit in mIRC, or pressing the Close Window button in the upper right corner of mIRC Windows, unless you had installed scripts like Polaris, or similar, the others were seeing a simple:

*** Quits: Yournick (your@mask..in.here) (Quit: )

That’s boring! I mean, if you installed Polaris, they’d be seeing this instead:

*** Quits: Yournick (your@mask.in.here) (Quit: (I was using Polaris IRC 2001) Version:(4.0 Platinum) Webpage:(http://www.polaris-central.com) Wasted:(1 Hour 38 Minutes and 36 Seconds Online))

or something alike.

Quite not original.

Now, suppose instead your quit message was something like:

*** Quits: Yournick (your@mask.in.here) (Quit: As soon as I get through with you, you'll have a clear case for divorce and so will my wife. - Groucho Marx)

Much better, at least in my opinion. If you now want to make your quit messages happy and colourful like that one, follow the instructions, and in a few steps you’ll do it .

So, first you need a text file with the lines you want to use in your Quit messages. Here you can find one. Make sure you save the text of the new window in a TXT file in your mIRC folder, or just do [Right Click/Save] on the link.

You can make a file yourself, but make sure you press Enter between the lines, and save that file in the installation folder of mIRC.

You’re ready for the tough work now.

Open the Aliases Panel (just press the button, or do [Tools > Aliases])

I discovered the GIF Uniform palette is the best for windows, thanks to this screenshot ;-)
This is how the quot alias in your Aliases Panel should look like

 

This is what youhave to copy/paste in the Panel (at the end of it):

/quot {
  //if (%Conta == $null) //set %Conta 0
  /inc %Conta 
  if (%Conta > $lines(Quotations.txt)) set %Conta 1
  //quit $read -l [ $+ [ %conta ] ] Quotations.txt
}

supposing you called the file Quotations.txt as I did, and put it in the same folder as mIRC, as I told you.

Now, all you have to do is to use a simple /quot instead of "/quit Message here" when quitting, and every time you’ll send a different Quit message .

Complete mIRC script for event sounds management

And after a long idle period on active scripting, I decided to come back with a useful script, to update a page about a similar issue, which anyway didn’t show anything such advanced.

This script does all the dirty job of managing events that inside mIRC are programmed to be able to generate sounds. It intercepts them, and, if you enabled sounds, it will play the WAVs appropriate for each event (I added to this script the WAVs I use on my own copy of mIRC)

If you wish to download the ZIP, here you go. All the instructions to load it are in the TXT, while in here you can see how you can customize the script itself, and learn how it works. The WAVs have been made mostly using MS Talkit, which you can find in the Download/AudioVideo section, in case you want to make your own WAVs; there’s also a guide to it in the HowTo’s section.

Follows the script listing:

alias sounds {
  //if ($1 == on) { /set %Soundon 1 | echo -a  $+ $color(info text).dd $+ *** Sounds have been activated }
  //if ($1 == off) { /set %soundon 0 | echo -a  $+ $color(info text).dd $+ *** Sounds have been disabled }
}

alias checkquery //if (($query($1).addr != $null) && (%Soundon == 1)) /splay query.wav

CTCP *:DCC:*:{
  if (($2 == send) && (%soundon == 1)) /splay dcc send.wav
}

on *:GETFAIL:*.*:{
  //if (%Soundon == 1) /splay dcc failed.wav
}

on *:FILERCVD:*.*:{
  //if (%Soundon == 1) /splay dcc finished.wav
}


on 1:OPEN:?:*:{
  //if (($pos($strip($1-),Matches for,1) == 1) && (%Soundon == 1)) /splay locator.wav
  else /timer 1 1 checkquery $nick
}

on *:NOTICE:*:*:{
  //if ((($pos($strip($1-),Requested File's on its way! Low CPS Limit:,1) != $null) || ($pos($strip($1-),is on its way.,1) != $null)  || ($pos($strip($1-),Now Sending!,1) != $null)) && (%Soundon == 1)) { /splay File Arriving.wav | goto bother }

  //if ((($pos($strip($1-),is on its way.,1) != $null) || ($pos($strip($1-),Now Sending!,1) != $null)) && (%Soundon == 1)) { /splay File Arriving.wav | goto bother }

  //if ((($pos($strip($1-),You are in que now with number,1) != $null) || (($pos($strip($1-),I have added,1) != $null) && ($pos($strip($1-),in my que,1) != $null)) && (%Soundon == 1))) { /splay Queued.wav | goto bother }

  //if ((($pos($strip($1-),You are already in my que list with,1) != $null) || ($pos($strip($1-),Sorry I am totally maxed out even in que list,1) != $null)) && (%Soundon == 1)) { /splay Queue Finished.wav | goto bother }

  //if ((($pos($strip($1-),Password accepted for,1) != $null) && ($nick == NickServ)) && (%Soundon == 1)) { /splay Identified.wav | goto bother }

  //if ($pos($1-,server flood protection activated,1) != $null) goto bother
  //if ($pos($1-,has opped,1) != $null) goto bother
  //if ($pos($1-,has deopped,1) != $null) goto bother
  //if ($poscs($1-,DCC Send,1) != $null) goto bother

  //if (%Soundon == 1) /splay notice.wav

  :bother
}

on *:TEXT:*:#:{
  //if ($pos($1-,$me,1) != $null) {//if (%Soundon == 1) /splay chimes.wav//if ($window(@calls,1) == $null) /window -n @calls//aline -hp @calls 11 $chan 9 [ $time ] 7 < $nick > 8 $1-
  }
}

on *:CONNECT://if (%Soundon == 1) /splay Connected.wav

on *:DISCONNECT://if (%Soundon == 1) splay Disconnected.wav

And follows the explanation (usage instructions at te bottom of the page).

The first three events (CTCP, on FILERCVD, on GETFAIL) trigger repectively when an incoming DCC send arrives, or a completion or fail of a DCC get occur, and, after checking if the sound output is enabled, play their files.

The on OPEN triggers when a query opens. It checks first if it’s a response of an MP3 sharing script, if not it waits 1 second before playing the Query sound. This is because you may have installed an antispam script (get a look at mine also in the IRC section) which closes instantly the query if it’s detected as spam: in this case you hear the sound only if the query is still open after a second.

The on NOTICE event checks for a lot of things. If NickServ identified you, if your MP3 request has been queued, is arriving, or hasn’t been accepted (works with SpR and SDFind responses only), ignores some frequent useless notices like the oppings, deoppings, flood protections, and after that plays a generic notice sound if no specific event is detected.

The last one, on TEXT, does what I like most: checks wether someone types your nick in a channel, and sounds chimes.wav, logging at the same time the line into a window. 2 things: first, you may want to disable it for specific occurencies (example: you are op, you voice someone, and his lame script -there’s no other way to call it- thanks you automatically; listening to the sounds may be… and is… annoying) so either you disable the sound at all (deleting the line containing "chimes.wav") or add some filters for those occurrencies (you must be a little fluent in mIRC scripting); second, the window logging looks really nice to me, but in the case you find it useless, delete the two lines containing "@calls". You may easily notice how you could completely delete the last statement if you don’t like it for both reasons. Also, it is somewhat"inefficient". That is, checks whatever is written in whichever channel, which means CPU usage. I have a single big on TEXT in my own script which checks a lot of things togheter, but if you have other scripts installed, they may have their own on TEXT routines. In that case the CPU utilization raises, so, if you are a lucky owner of a 1GHz+ CPU, no big deal, only keep in mind that on slower machines, having a mIRC instance which sucks 5% of the CPU is very annoying .

 

Now, how to use it? Simple, after having loaded the script (follow the instructions in the TXT file), do /sounds on and you will be all setted. The script wll begin to play the WAVs when it’s come the moment. Want to watch a movie or play a game? Type /sounds off and mIRC won’t bug you. That’s all.

How to cutomize it? Basically, you can change the name ot location of the WAVs, delete some parts you’re not interested in, but mostly, add other handlers, if you can, and care. Only thing: mIRC will continue to beep if someone writes other lines in a query after the first one, even if sounds are off. I could change that, but I was too lazy in that moment; I don’t even plan to do it in the future… take it as a good excercise on scripting.