Lag checker

By RubixCube on Sep 30, 2007

Checks your lag every [x] seconds when you connect. You can also get it echoed when you right-click the channel menu and go to Lag check. Many other options are configurable there as well, please take your time to setup otherwise you might receive a few errors. Thanks in advance.

Usage:

Enable script: channel right-click -> Enable
Disable script: channel right-click -> Disable
The number of seconds before it updates the titlebar: channel right-click -> Check every [x] seconds -> Enter time in seconds (recommended to be a little higher)
Check your lag: channel right-click -> Check

  • Note: When you quit or disconnect, it unsets the %temp_t variable and halts the timer.

  • RubixCube
; *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
; ~     Lag check        
; *         RubixCube        
; ~                  
; *     Contact          
; ~         Email        
; *            rub1xcube@yahoo.com 
; ~                  
; *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* 

on *:connect:{
  if (%_lag_conf_ = on) && (%lag_time) .timerl_check 0 %lag_time /form_lag_
}

alias form_lag_ {
  if (%_lag_conf_ = on) { 
    set %temp_t $ticks
    .raw ping %temp_t
    titlebar Lag: $+($calc($calc($ticks - %temp_t) / 1000),sec)
  }
}

alias lag_ { 
  if (%_lag_conf_ = on) {
    set %temp_t $ticks 
    .raw ping %temp_t
  }
}

on ^*:PONG:{ 
  var %u $calc($ticks - %temp_t)
  echo $colour(info) -a Lag on $server is: $+($calc(%u / 1000),$chr(32),seconds,.)
}

on *:disconnect: .timer1_check off | unset %temp_t
on *:quit: .timer1_check off | unset %temp_t

menu channel { 
  Lag check:
  .Enable:set %_lag_conf_ on
  .Disable:set %_lag_conf_ off
  .Check every [x] minutes:{ 
    var %c $$?="Enter time in seconds:"
    set %lag_time %c
    if ($timer(l_check)) .timerl_check off
    .timerl_check 0 %lag_time /form_lag_
  }
  .Check:lag_
}

on *:load: echo $colour(info) -a Please take your time to configure everything through the channel menu. Thank you.

Comments

Sign in to comment.
mrmr   -  May 02, 2010

in the "menu channel"> .Check every [x] minutes:{
var %c $$?="Enter time in seconds:"

I suggest to change from "minutes" to "seconds in the menu too.

 Respond  
RubixCube   -  Oct 03, 2007

Alright, I made the snippet ping the server. It should return a better value now, just make sure to set the num. of seconds to be a bit higher. ;)

 Respond  
RubixCube   -  Oct 03, 2007

Yeah, I was thinking about that. I don\'t really want to ping the server (as an example) every two seconds. I\'ll probably end up doing that anyway and just recommend a higher integer of time.

 Respond  
KuTsuM   -  Oct 03, 2007

This will always result in 0: var %u $calc($ticks - $ticks) Hence the reason it always displays the lag time as 0secs..

 Respond  
Akishoot   -  Oct 02, 2007

Nice work on this, RubixCube. (=

 Respond  
ZiX   -  Oct 02, 2007

Nice job ;]

 Respond  
Kyousoukyoku   -  Oct 01, 2007

Nice job. I like how original and configurable this is. =P

 Respond  
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.