Bloopy presents a "WhatPulse AFK" script for mIRC

edit: Since WhatPulse v2, this does not work. I use a manual away script now: http://hawkee.com/scripts/33500316/

[i]Hi, I have my computer running mIRC nearly all the time, so I decided it would be good for me to have a script that changes my nickname automatically when I go away. Now that I’m sure it works well, I’ll share it with you. Most mIRC away scripts only check if you are idle on IRC, and don’t know if you are at your keyboard using other programs. This one does. 8)

This script checks when WhatPulse last modified its data file to get an idea of whether you are AFK or not, and if necessary it changes your nickname according to the nicknames you have set in the options. WhatPulse checks if it needs to update its file every 5 minutes, so the effect of this script is not instant. When you go AFK, it may be an extra 6 minutes before your nick changes to your away nick. When you come back from being away, it could also be up to 6 minutes before your nick changes back. However, if you type something on IRC, your nick will change back immediately. This script should not affect WhatPulse in any way.

INSTRUCTIONS:

[list]
[*]First, load the script. Place WPAFK.mrc in your mIRC directory and use the following command in mIRC:

/load -rs WPAFK.mrc

You will then be asked to enter a few settings.

If you don’t want to place it in your main mIRC directory, you can specify a sub-directory or path, for example:
/load -rs scripts\WPAFK.mrc or /load -rs C:\scripts\WPAFK.mrc
[/list]
[list]
[*]Second, if you have WhatPulse set to pulse every few hours, I suggest you change it to pulse after a certain number of keys or when you shut down, or just pulse manually. This is because if you pulse after a certain number of hours then the script will guess that you are at your computer every time it pulses.
[/list]

This script can work across multiple server connections in mIRC. Your nick will change at slightly different times on each server. The script should hopefully also work on old versions of mIRC which don’t support multiple server connections. If it can’t find the file, it will think that you are away all the time.

If you change your nickname the script will soon change it back, so you need to change your nickname in the script’s menu. It also doesn’t set any kind of away message or send any message to the channels you are on.

I’m happy with how the script works for me now, but feel free to post some questions or feature requests.

Update, October 2005:

The script can now let you have different nicknames on different networks, and it asks you for a default away suffix to add to your nickname when you go away. Your away nick doesn’t have to use a suffix format though. It also remembers the nicknames you used on a network, and whether you had the script on or off for that network.

It now looks for WhatPulse’s data file in C:\Program Files\WhatPulse\ by default, so you may not need to tell it where WhatPulse is. You can also set a different location when you need to.

You can now set an away time: the number of minutes before you are considered away. This means you can go away and come back for 5-10 minutes at a time without your nickname changing often. You can also specify to temporarily disable the script for a number of minutes - this is good if you are just back for a moment and you don’t want the script to think you are back from away.[/i]

Good idea in a way, but WhatPulse writes the WhatPulse.bin file every ~5 minutes even if you’re AFK.

I’ve been using this away script and it works just as I described. The modified time of the file that I am reading doesn’t change unless a key or mouse button has been pressed or the program has pulsed during that 5 minutes.

I blame Windows. :wink:

It does write the file every 5 minutes, but if it’s the same file size (nothing has changed) Windows doesn’t change the mtime. Nice. :slight_smile:

Windows is clever! :rolleyes:

Windows is not, windows is a well-covered ripper :wink:

lovely

:smiley: so true. If FF didn’t have tabbed browsing, per-pixel alpha png rendering and so on then IE7 wouldn’t either.

windows is evil EVIL i tell you!

I think it’s better to use a /scid -atl /nick %nick.WPafk instead of just /nick, as that will change the nick for all servers you’re on and not just the one you currently have focus on.
Should work when you’re only on one server as well.

I’ll look into that, that might be a good idea. However, as it is currently, you can turn it off on one server and keep it on on another server, which I think could be quite useful.

nice idea, GJ

I’ve just overhauled the script somewhat, so get the new version! If you have the old version installed, first uninstall it using the following command in mIRC:

/unload -rs WPAFK.mrc

Then, download the updated version. :razz:

These are the main changes:

[QUOTE=Bloopy]Update, October 2005:

The script can now let you have different nicknames on different networks, and it asks you for a default away suffix to add to your nickname when you go away. Your away nick doesn’t have to use a suffix format though. It also remembers the nicknames you used on a network, and whether you had the script on or off for that network.

It now looks for WhatPulse’s data file in C:\Program Files\WhatPulse\ by default, so you may not need to tell it where WhatPulse is. You can also set a different location when you need to.

You can now set an away time: the number of minutes before you are considered away. This means you can go away and come back for 5-10 minutes at a time without your nickname changing often. You can also specify to temporarily disable the script for a number of minutes - this is good if you are just back for a moment and you don’t want the script to think you are back from away.[/quote]

To replies that Windows is clever, or evil, or etc. It doesn’t edit it if i’s the same file size. It edits it if there is new information. But why not set whatpulse not to edit it every five minutes and just make it check to see if there’s something new, and if there is, then overwrite? It would save 0.0000000001 seconds of my hard drive’s life span. :slight_smile:

Yeah, unlike what wasted said, the size of WhatPulse’s file never changes. :stuck_out_tongue:

:slight_smile: Just updated the script, a couple of bugs are fixed.

nice it works great!

Glad you like it, let me know if you have any suggestions.

It was awesome, well, almost everything, but I think it’s something wrong with my mIRC because I had to go to Commands - AFK (something) and something about locate, and when I did, my irc crashed:<

The script could do with updating, particularly so it doesn’t spam you so much if it can’t find the WhatPulse file. However, there shouldn’t be anything in the script to cause it to crash there, it just brings up a dialog for you to choose a folder.

Which version of mIRC? One thing you can check is whether the folder dialog always causes your mIRC to crash. Go to mIRC options, IRC → Logging, and see if you can click the logging folder button (default setting is \mIRC\logs\ folder) and navigate to C:\ …or don’t you have a C: drive?