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?


We don't just write the scripts, we put them to the test! (ScriptBusters)
#39959 06/08/03 12:42 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
.ctcp ping $nick - pings a nick
.ctcp ping $chan - pings everyone in a channel


new username: tidy_trax
#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.


We don't just write the scripts, we put them to the test! (ScriptBusters)
#39961 06/08/03 02:15 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.


We don't just write the scripts, we put them to the test! (ScriptBusters)
#39963 06/08/03 02:40 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.


We don't just write the scripts, we put them to the test! (ScriptBusters)
#39965 06/08/03 06:09 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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)) $+ .


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#39966 06/08/03 09:58 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
qwerty watches Hammer doing all this amazing stuff shocked


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard