thats one way, but how about:
Code:
on *:connect: {
timer [ $+ [ $network ] $+ . $+ [ $server ] $+ .ping ] 0 30 raw ping $server $ticks
}
on ^&*:pong: {
%lag = $duration($calc(($ticks - $2) / 1000))
}

I did not test it, but i have somthing simular running on my mIRC smile