All pastes #49670 Raw Edit

Unnamed

public text v1 · immutable
#49670 ·published 2006-04-17 23:46 UTC
rendered paste body
alias randomstring {
  var %j = $1, %text
  while (%j) {
    %text = %text $+ $chr( $rand(48,122) )
    dec %j
  }
  return %text
}

ON *:START: {
  titlebar
}

on *:CONNECT: {
  unset $+(%,lag.,$cid)
  unset $+(%,lag.pass.,$cid)
  $+(.timerLAGMETER.,$cid) 0 %lagmeter.delay lagmeter
}

on *:DISCONNECT: {
  unset $+(%,lag.,$cid)
  unset $+(%,lag.pass.,$cid)
  showlag
}

alias lagmeter {
  if (!$eval($+(%,lag.pass.,$cid),2)) {
    var %pass = $randomstring(16)
    set $+(%,lag.pass.,$cid) %pass
    .msg $me -ping %pass $ticks
    titlebar
  }
}