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.
Code
output:
Code
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.
Oh yeah I must've been spaced out for a sec that I overlooked the alias...and no I ain't got no lag...:P But I do often type in the wrong channel, and people were like, wot? lol
I think the $active identifier may return other window names... if the client running the code is not looking at the active channel when the message is transmitted. Using $chan is more fitting...
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.