mIRC Home    About    Download    Register    News    Help

Print Thread
Ping #119946 11/05/05 01:40 PM
Joined: Dec 2002
Posts: 481
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 481
How can I make ctcp ping reply with e.g: 0.90 secs ??

Re: Ping #119947 11/05/05 03:04 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
the default ping sends $ctime to whoever you are "pinging".
to get hundredths of a sec use $ticks
Make sure you replace any /ping aliases and any ctcp ping events to use $ticks.

Re: Ping #119948 12/05/05 09:05 PM
Joined: Dec 2002
Posts: 481
Deep3D Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 481
i don't get this bit** to work....

on 1:PING:ctcpreply $nick PING $ctime secs test test

help me? :tongue: :tongue:

Re: Ping #119949 12/05/05 09:56 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Wrong event. on PING is to capture the PING? PONG! event (/help on PING). What you want is the on *:CTCPREPLY:PING *: event.

Code:
alias ping {
  if $show {
    echo -atic ctcp * Pinging $$1
  }
  .raw privmsg $$1 $+(:,$chr(1),PING $ticks,$chr(1))
}
on *:CTCPREPLY:PING *:{
  echo -atic ctcp * Ping response from $nick $+ : $round($calc(($ticks - $2) / 1000),2) seconds from $server
  .raw NOTICE $nick :Ping response from $nick $+ : $round($calc(($ticks - $2) / 1000),2) seconds from $server
  halt
}


cool


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C