Multiple Server Titlebar Lagging Time

By h3lp on Jun 05, 2007

This snippet will display your current lagging time in all server you joined. It will be displayed one by one every 10 seconds. It's an oldies but a goodies.

on *:connect:{
  titlebar Connected to [[ $server ]]
  $+(.timer,.,PING,.,$cid,.,$server) 0 120 .ctcp $!me ping
  $+(.timer,.,CHECKLAGGINGTIME) -i 0 10 display_lagging
  ctcp $me ping
}

ctcp *:ping:*:{ haltdef | .ctcpreply $nick PING $ctime }

on *:ctcpreply:*:{
  haltdef
  if ($nick == $me) && ($1 == PING) set $+(%,LAGGINGTIME,.,$cid,.,$server) $duration($calc($ctime - $2))
}

on *:disconnect:{
  titlebar [[ $cid ]] Disconnected from [[ $server ]]
  set -u20 $+(%,LAGGINGTIME,.,$cid,.,$server) Disconnected
  $+(.timer,.,CHECKLAGGINGTIME) -i 0 10 display_lagging
}

alias display_lagging {
  var %c = $var(%LAGGINGTIME*,0), %time = 0
  while (%c) {
    var %cid = $gettok($var(%LAGGINGTIME*,%c),2,46), %server = $gettok($var(%LAGGINGTIME*,%c),$+(3,-,$numtok($var(%LAGGINGTIME*,%c),46)),46)
    $+(.timer,.,LAGGINGTIME,.,%cid,.,%server) 1 %time titlebar $!chr(91) %cid $!chr(93) $!chr(91) %server $!chr(93) LAGGING $!chr(91) $($!var(%LAGGINGTIME*,%c),2) $!chr(93)
    dec %c
    inc %time 10
  }
  $+(.timer,.,CHECKLAGGINGTIME) -i 0 %time display_lagging
}

on *:exit: titlebar

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.