Originally posted by Helio
note: this code is beta, and, due to the slight increase in load, please do not use this script unless you are having frequent ping timeout problems or reconnect problems. If you experiance any issues with this script, please join #engineering and describe the problem in the channel, or, post a reply with a description.
To install:
1. Go to Tools -> Scripts Editor
2. Click the remotes tab
3. Click File -> New
4. Copy and paste the following script into the window
5. Click File -> Save As -> keepalive.mrc
6. Restart mIRC for the script to take effect
7. Enjoy!!
Edit: added experimental patch to the code to prevent infinite reconnect loops. Reconnect code is commented until this this patch is proven to work
on *:connect:{
.startyline
}
alias startyline {
.echo -s starting keep alive
.hadd -m nets $network $+ $cid 0
.timer $+ $network $+ $cid -o 0 30 yline
}
alias yline {
if ($hget(nets,$network $+ $cid) == 1) {
.echo -s reconnecting to $server (PING TIMEOUT)
;.server $server
}
else {
hadd -m nets $network $+ $cid 1
.quote PING : $+ $ctime
}
}
on *:pong:{
.hadd -m nets $network $+ $cid 0
.halt
}