mIRC Homepage

PING Events

Posted By: naki

PING Events - 06/08/03 12:38 AM

I am making a bot using miRC Sockets. How does ctcp ping work?
Posted By: pheonix

Re: PING Events - 06/08/03 12:42 AM

.ctcp ping $nick - pings a nick
.ctcp ping $chan - pings everyone in a channel
Posted By: naki

Re: PING Events - 06/08/03 12:54 AM

...

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.
Posted By: codemastr

Re: PING Events - 06/08/03 02:15 AM

That's where mIRC's /debug command comes in.

/debug @debug

then /ctcp ping yourself and see what happens.
Posted By: naki

Re: PING Events - 06/08/03 02:38 AM

... I know all this. the numbers that the ping gives, what do you do with it.
Posted By: codemastr

Re: PING Events - 06/08/03 02:40 AM

The number is the value of $ctime
Posted By: naki

Re: PING Events - 06/08/03 04:37 AM

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.
Posted By: Hammer

Re: PING Events - 06/08/03 06:09 AM

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)) $+ .
Posted By: qwerty

Re: PING Events - 06/08/03 09:58 AM

qwerty watches Hammer doing all this amazing stuff shocked
© 2020 mIRC Discussion Forums