• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#23 - 08/01/06 01:29 AM Connection Keep Alive Open Beta
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
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

Code:
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
}

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top


Moderator:  Jeff, mandy, usrbingeek