I am making a bot using miRC Sockets. How does ctcp ping work?
.ctcp ping $nick - pings a nick
.ctcp ping $chan - pings everyone in a channel
...
ctcp ping would not work with a socket bot. I want to know how it works. The nuts and bolts of getting the ping repy.
That's where mIRC's /debug command comes in.
/debug @debug
then /ctcp ping yourself and see what happens.
... I know all this. the numbers that the ping gives, what do you do with it.
The number is the value of $ctime
I didnt ask what the value was, I asked what is needed to be done with it. When you send a ping to someone it sends that number, when their client sends the ping reply, what does it do with that number so I can get the correct lag.
Hammer types:
/ctcp Mike` PING
mIRC sends:
PRIVMSG : $+ $chr(1) $+ PING $ctime $+ $chr(1)
PRIVMSG Mike` :PING 645266253
Mike` receives it and sends back whatever follows PING unchanged:
ctcp *:PING*:?: ctcpreply $nick PING $1-
/ctcpreply Hammer PING 645266253
NOTICE Hammer :PING 645266253
Hammer receives it and subtracts the numeric value after the PING from his current $ctime to retrieve the difference between the ctime he sent the ping and when he got the response back.
on *:CTCPREPLY:PING*: echo $color(ctcp) -ati2 * Ping response from $nick is $duration($calc($ctime - $2)) $+ .
qwerty watches Hammer doing all this amazing stuff