This is a lag checker that starts automatically on connect, pings the server every 55 seconds, and warns if lag exceeds 5 seconds using beeps and the new $tip feature. Double clicking the popup $tip will focus the Status Window of the lagged connection.
Menu items are provided to immediately check lag, to change the timing and threshold, and to turn off lag checking.
on ^*:PONG:{
var %x $gettok($2,2,58),%Lag = $round($calc(($ticks - $gettok($2,1,58))*.001),2)
if %x { haltdef }
if !$tip(Lag $cid) && %Lag > %x {
beep 3
noop $tip(Lag $cid,Lag %LaG seconds, $me $network,9,$mircexe,41,window -ax "Status Window")
}
}
menu * {
-
Check Lag:ping $ticks $+ :$
Auto-Check Lag 3/33:.timerLag $+ $cid 0 33 ping $!ticks $!+ :3
Auto-Check Lag 9/99:.timerLag $+ $cid 0 99 ping $!ticks $!+ :9
Auto-Check Lag Off:.timerLag $+ $cid off
All Auto-Check Lag Off:.timerLag* off
-
}
on *:CONNECT:.timerLag $+ $cid 0 55 ping $!ticks $!+ :5
Ghost_Writer brought it to my attention that the icon was not needed as I posted above and could have been left null as such:
$tip(Lag,Lag %LaG seconds, $me $network,9,,,window -ax "Status Window")
I'm leaving it the way it is to avoid having to change the screen shot as the icon does not cause any issues. Also, I think the icon fits the script.
Jonesy
Thanks for the comments. I too sometimes have the same nickname on more than one network and have updated the snippet as suggested. At the same time I decided to add a feature that allows the user to double click the popup $tip and focus the status window of the lagged connection. To add this feature it was neccesary to specify an icon for the $tip so I choose to use one supplied with mirc.exe, specifically the one with the broken lightning bolt and question mark. (After all these years I still havent figured out why broken lightning bolt means connected and complete lightning bolt means unconnected.)
I only mentioned $server in case someone else was thinking of it.
Btw, your description of the $network identifier is not exactly correct.
/help $network
Returns the name of the IRC network you are currently connected to.
Note: It may not be possible to get this info if a network doesn't provide it.
$network and $server are not the same thing. $network may have more than one $server and some $network may allow more than one connection. also (unfortunately) $network and $server DO NOT have to be unique names on the internet. The DOMAIN name MUST be unique and so must $serverip BUT $network and $server are sent out by the SERVER in the raw 001-005 lines during connect and can be anything they set it to. Traditionally they will reflect/include the registered domain name in some manner. Also, if the network has more than one server all the servers typically use the same name for $network (altho it is not required).
Note: In the screen shot Local-Chat is the name of my 'network'
Ahh ok, i am connected to many different servers as the same nickname, so this script to me would be fairly useless without the changes i'd make.
I don't really get your comment though, using $server? I suggested $network which gives the network suggested name of the server you're on.
How about comine them both so you would get something like "QuakeNet (Jonesy44)"?
Jonesy:
Using $network was considered but dismissed because often I am connected more than once per network so it seems easier for me to know what is lagging if it is per nickname. Also consider that the way it is written it creates one lag test timer per server connection but using $server would be even more difficult to figure out what was lagging. It is useful to test each server connection and not just each network connection however, if you wish to change it to $network then also consider changing the on connect event to match as well:
on *:CONNECT:.timerLag $+ $network 0 55 ping $!ticks
You will also need to edit the menu items to match. To be honest I only use the Check Lag Now menu item and provided the other items to make it appear more complete.
This is about the 10+ lag test version I have written over the years including one version that averaged lag over time storing the values in a hash table so as to calculate average lag to too many decimal places. After all this i arrived at the following conclusions: