mIRC Home    About    Download    Register    News    Help

Print Thread
How to get a accurate ping time? #18335 06/04/03 02:21 PM
Joined: Jan 2003
Posts: 127
L
littlecramp Offline OP
Vogon poet
OP Offline
Vogon poet
L
Joined: Jan 2003
Posts: 127
as above?

Re: How to get a accurate ping time? #18336 06/04/03 04:53 PM
Joined: Jan 2003
Posts: 18
P
PeteM Offline
Pikka bird
Offline
Pikka bird
P
Joined: Jan 2003
Posts: 18
a ping time from where, exactly, server of another user, either way use that of /ping nickname/server $ctime, and when you get your pong/ping reply, calcuate the difference between the response and your current $ctime, yet.. another way would to be use that of $ticks in sending/working out

Re: How to get a accurate ping time? #18337 07/04/03 05:08 AM
Joined: Jan 2003
Posts: 127
L
littlecramp Offline OP
Vogon poet
OP Offline
Vogon poet
L
Joined: Jan 2003
Posts: 127
I wanted to ping a user and get the response in milliseconds. How to do that?

Re: How to get a accurate ping time? #18338 07/04/03 05:17 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Here is my method:
Code:
on *:CTCPREPLY:ping *:{
  echo $color(ctcp) -at [ $+ $nick $1 reply]: $calc($ticks - $2) ms
  haltdef
}
alias ctcp {
  if ( $2 == ping ) {
    echo $color(ctcp) -at -> $chr(91) $+ $1 $+ $chr(93) PING
    .msg $1 PING $ticks $+ 
  }
  else { !ctcp $1- }
}