mIRC Home    About    Download    Register    News    Help

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

#119947 11/05/05 03:04 PM
Joined: Dec 2002
Posts: 1,245
M
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.

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

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

help me? :tongue: :tongue:

#119949 12/05/05 09:56 PM
Joined: Dec 2002
Posts: 1,321
H
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

Link Copied to Clipboard