mIRC Home    About    Download    Register    News    Help

Print Thread
#39958 06/08/03 12:38 AM
Joined: Feb 2003
Posts: 143
N
naki Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
I am making a bot using miRC Sockets. How does ctcp ping work?

#39959 06/08/03 12:42 AM
P
pheonix
pheonix
P
.ctcp ping $nick - pings a nick
.ctcp ping $chan - pings everyone in a channel

#39960 06/08/03 12:54 AM
Joined: Feb 2003
Posts: 143
N
naki Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
...

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.

#39961 06/08/03 02:15 AM
C
codemastr
codemastr
C
That's where mIRC's /debug command comes in.

/debug @debug

then /ctcp ping yourself and see what happens.

#39962 06/08/03 02:38 AM
Joined: Feb 2003
Posts: 143
N
naki Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
... I know all this. the numbers that the ping gives, what do you do with it.

#39963 06/08/03 02:40 AM
C
codemastr
codemastr
C
The number is the value of $ctime

#39964 06/08/03 04:37 AM
Joined: Feb 2003
Posts: 143
N
naki Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Feb 2003
Posts: 143
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.

#39965 06/08/03 06:09 AM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
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)) $+ .

#39966 06/08/03 09:58 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
qwerty watches Hammer doing all this amazing stuff shocked


Link Copied to Clipboard