Lag check for a bot.

By Protheus on May 03, 2017

This based on shideezhi's code (http://hawkee.com/snippet/4331/). I simply added the trigger for the bot, and some formatting to fit my theme.

alias lagcheck {
  if (%hilag == $null) { set %hilag -1 }
  if (%lolag == $null) { set %lolag 999 }
  set %lagchan $chan
  .enable #lagcheck 
  .raw $ticks 
}
menu channel { 
  Check lag:lagcheck 
}
#lagcheck off
raw 421:*: {
  var %lag = $calc(($ticks - $2) / 1000)
  if (%lag > %hilag) { set %hilag %lag }
  if (%lag < %lolag) { set %lolag %lag }
  msg %lagchan 3{14-3 %lag 14seconds. $& 14Highest:3 %hilag $+ s; 14Lowest:3 %lolag $+ s. 14-3} 
  .disable #lagcheck 
  haltdef
}
#lagcheck end

on *:TEXT:*:#: {
  if $1 == .lag {
    /lagcheck
  }
}

Comments

Sign in to comment.
DragonHeart   -  27 days ago

Line 16 needs to be corrected, it doesnt get translated to CTRL-K's... Other than that, works like a champ.

 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.