Peace and Protection forum

Secret /PING

craze - 1-5-2010 at 10:28

Sending CTCP's to someone might be considered a bit intrusive, so I figured out this way to probe the network latency by using the extended whois. Because the extended whois is requesting information from the server my target is connected to, I can time the response and get a pretty good idea of how "far out" my chat partner is.

Code:
on *:INPUT:*:if ($1 == /ew) whoisping $2 alias whoisping set %wc.secping. [ $+ [ $1 ] ] $ctime raw 317:*:{ if (%wc.secping. [ $+ [ $2 ] ] ) { .timer 1 1 echo $color(notice) -t $+(-,$server,-) $+($chr(2),$2,$chr(2)) roundtrip delay: $+($chr(2),$duration($calc($ctime - %wc.secping. [ $+ [ $2 ] ] ))),$chr(2)) unset %wc.secping. [ $+ [ $2 ] ] } }


Now every time I "/ew someone", I will get a notice indicating what a ping response would be like. It just doesn't account for any congestions between the target and his/her server.

I added the "timer 1 1" when I wanted my notice to appear after the whois, but doing the echo straight away will put it back on top.

[Edited on 1-May-2010 by craze]

[Edited on 25-Sep-2010 by craze]