mIRC Homepage
Posted By: Cheech lag bar - 26/12/03 01:59 AM
i would like to create a lagbar using a dialog i think i can do this but i dont know how to check the lag ? i assumed you would use the ping from the server to update it but not sure ?
i would just like to know how to get the actuall sirver ping or whats best i messed around with a timer and /ping $me but there must be a better way?

thanks .
Posted By: Hitchhiker Re: lag bar - 26/12/03 03:49 AM
I've seen people do it by ctcp $me ping, but that will give you a false reading, in that it will be double your lag, and it uses more bandwidth because you are sending more than one message to the server. You can just send the server a number to pong to you, test with this.
Code:
on ^*:pong:{
  if ($2 isnum) {
    echo -s SERVER lag is $calc($ticks - $2) ms.
    halt
  }
}

then just type //ping $ticks
that will work out the lag in miliseconds.
Posted By: Cheech Re: lag bar - 26/12/03 05:07 AM
doesnt seem to do anything ? is
On ^*:pong: valid on all mirc versions ?
is there not an event to simply evaluate the Ping? pong! event ?
Posted By: Hitchhiker Re: lag bar - 26/12/03 05:11 AM
yes on ping and on pong are those events.

You dont need the on ^*:pong that was just to halt the default * PONG from irc.servername.com: <number>
should work ok, try a new remote file, see if that works.
Posted By: aquanight Re: lag bar - 26/12/03 04:18 PM
You could possibly also calculate the SERVER lag of another user, possibly with CTCP PING of the user followed by the PING/PONG method. Once you have both times, I would think subtracting them could tell you the server lag of the other user.

BTW, starting the PING/PONG process will require this command unless you delete /ping from your aliases:
//raw -q PING $ticks
Posted By: Deep3D Re: lag bar - 26/12/03 04:19 PM
how do you make the lagometer thing? :tongue:
Posted By: Cheech Re: lag bar - 26/12/03 07:07 PM
well i havent quite finished it eyt but currently i use

Code:
 
;on ^*:pong:{  
if ($2 isnum) {    
  set %lagcheck2 $calc($ticks - $2) 
  echo -a 00,04 SERVER lag is $round($calc(%lagcheck2 / 1000),2) seconds.
  halt 
}
}
;on ^*:PING:{ 
if ( $server isin $1- ) {
inc %lagcheck
}
if ( %lagcheck &lt;= 4 ) { goto end } 
elseif ( %lagcheck == 5 ) {
  /.raw PING $ticks
  set %lagcheck 1
}
:end
halt
}


i check the lag on every 5th ping? pong! event you could do it each time but i figured it wasnt necessary to update it that often from . now i just need to dock it somewhere .lol
© mIRC Discussion Forums