Quote:
if ($nick($chan,$nick(#,%x,r)).idle >= 300)


Don't forget to change $chan to $1 as well

--> if ($nick($1,$nick($1,%x,r)).idle >= 300)

Script:
Code:
 
alias idle { .timer 0 301 idle2 #HelpCenter }

alias idle2 { 
  if ($me !isop $1) { echo -a You are not oped on $1 | return }
  var %x = $nick($1,0,r)
  while (%x) { 
    if ($nick($1,%x,r).idle >= 300) {
    kick $1 $nick($1,%x,r) You have Idled in $1 for 5mins - Please Come back if you need help. 
    }
    dec %x
  }
}

It is important that you understand the difference between having idle time higher than 300, and having a timer check for idle times every 301 seconds.

Checking every 301 seconds, means that the maximum idle time of a person in your channel is (current idle + 301) seconds. The lower you set the timer to, the less maximum idle time they can have.

To explain this the easiest way: if you do /idle, then the people who are on your channel for say for example 250 seconds, will only get kicked after 301 seconds after typing /idle, which means they'll have been idle for a total amount of 551 seconds.

Greets

Edit: added checking if oped, + small change thx to Iori

Last edited by FiberOPtics; 31/05/04 01:47 AM.