Type /lag in any chan and it will message the chan your lag to the server.
alias lag {
.raw PING $ticks
.enable #pong
}
#pong off
on *:PONG:{
msg $active My lag is currently $calc($ticks - $2) $+ ms
.disable #pong
}
#pong end
napa, I tend to not use pipes as this slows down scripts, probably not noticeably but it has to split up the line then read it, I made this script to work as fast as it could.
This is something people tend to get confused about. That is only true in large snippets, not something as little as 176 bytes (napa's example with pipes). For example: load these two scripts.
alias e.me {
var %x $ticks
echo -a hi
echo -a $right($calc(($ticks - %x) / 1000),2) ms
}
alias e.me2 { var %x $ticks | echo -a hi2 | echo -a $right($calc(($ticks - %x) / 1000),2) ms }
output:
hi
15 ms
hi2
15 ms
As you can see, they're both going to out put 15 ms, and this is only because /echo -a tends to slow down things. Now I'm not encouraging you to use pipes, by all means avoid them (since it's a good scripting technique anyway), but they're frowned upon MAINLY because they make your scripts look like a mess, they only slow down your script if it's a large one with a lot of pipes.