Neither of those two examples do what the OP asked for, though... Here's one way to do it:

on *:TEXT:!Ping:#: { .msg $nick $chr(1) $+ ping $ticks ticks $+ $chr(1) | set %pingchan $chan }

on *:CTCPREPLY:ping & ticks:{ if ($2 isnum) { var %d = $calc($ticks - $2) | msg %pingchan 4 $+ $nick your ping reply was:[12 $+ $iif(%d > 999,$duration($calc(%d / 1000)) 12) $+ $calc(%d % 1000) $+ ms $+ 4] I am on server:[12 $+ $server $+ 4] } }