!Ping, !Time and !Version
Platform: mIRC
Published Dec 22, 2007
Updated Dec 22, 2007
!Ping: CTCP's the nick to get the ping reply.
!Time: CTCP's the nick to get the time reply.
!Version: CTCP's the nick to get the version reply.
Syntax:
* !Ping <Nick>
* !Time <Nick>
* !Version <Nick>
on *:TEXT:*:#:{
if ($1 == !Ping) || ($1 == !Time) || ($1 == !Version) {
if ($2 != $null) {
set %ctcp.chan $chan
set %ctcp.nick $2
set %ctcp.cmd $remove($1,!)
ctcp %ctcp.nick %ctcp.cmd
}
}
}
on *:CTCPREPLY:$($+(%ctcp.cmd,*)):{
if ($nick == %ctcp.nick) {
if (%ctcp.cmd == Ping) { msg %ctcp.chan %ctcp.nick $+ 's ping reply is: $+($duration($calc($ctime - $2-)),.) }
if (%ctcp.cmd == Time) { msg %ctcp.chan It is $2- at the place where %ctcp.nick lives. }
if (%ctcp.cmd == Version) { msg %ctcp.chan %ctcp.nick is using: $+($2-,.) }
}
unset %ctcp.*
}
raw 401:*:{
msg %ctcp.chan %ctcp.nick is not online.
unset %ctcp.*
halt
}