Originally Posted By: jaytea
oh boy if i had a penny for every time someone has fallen into this trap ;>


Code:
//inc -z %var 30 | if (%var > 570) {


Unfortunately you kind of fell into the same trap. (I expected more out of you, jaytea!) If someone triggers that 19 times in a split second, the var will be at 570, which means if you waited 4 minutes, and then did that command 9 more times, the %var would be around 600. (If the %var == 570, it'd take 9.5 mins to fully unset.)


Edit: Personally, I'd go with the hash table way. Though as a little example of other fun ways to handle things just like this, you could use something like:

Code:
alias altway {
  var %d = $calc($ctime - 30)
  while ($gettok(%altway,1,32) < %d) { set -k %altway $deltok(%altway,1,32) }

  set -u30 %altway $addtok(%altway,$ctime,32)

  if ($numtok(%altway,32) > 19) { echo -a ITS OVER 9000! Er, I mean over $v2 :( }
}

Last edited by Rand; 18/03/09 01:45 AM.