Ah ic,

well then let me propose to you 2 solutions, so pick one of them:

Solution 1
Code:
  
#idlekicker on 
[color:red]  [/color] 
on me:*:JOIN:#needhelp: .timer 0 300 CheckIdlers
[color:red]  [/color] 
#idlekicker end
 [color:red]  [/color] 
alias CheckIdlers {
  var %chan = #needhelp
  if ($me !isop %chan) { echo -a You are not oped on %chan | return }
  var %a = $nick(%chan,0,r)
  while (%a) { 
    if ($nick(%chan,%a,r).idle > [color:red]600[/color]) { ban -k %chan $nick(%chan,%a,r) 2 Idling is not allowed! }
    dec %a
  }
}


What will this script do?

1) When you join your channel #needhelp, a timer will start. That timer will be called upon every 300 seconds (= 5 minutes) and it will trigger the alias CheckIdlers.

2) So every 5 minutes the alias CheckIdlers will scan your channel for the idle times of all the regular nicks (not ops, voices). It will see if the idle times are higher than 600 seconds, and if so, it will ban/kick them from your channel.

To change the permitted idle time for your users, you simply change the 600 to whatever value you want. Say that your users may idle for 15 minutes, then simply change 600 to 900 in the alias CheckIdlers.

The first 300 = at which interval do you want to check for idlers. You can set this to whatever, like say if you want to check every 2 minutes, you would change it to 120.

The second 600 = the maximum allowed idle time that people may have when being on your channel.

Note that because the timer is only triggered every 300 seconds, the users have a safety interval of 300 seconds. This means that the maximum theoretical idle time that they can have is 600 + 300= 900 seconds. That's because the timer isn't checking every second if the idle time is above 600 seconds.

So the smaller you make the interval (perhaps change to 60 seconds), the lesser their maximum theoretical idle time will be, being: 600 + 60= 660


Solution 2
If you really really want to make sure that they only idle 600 seconds, and not 1 second more than that, then there's no other way than to create individual timers.
The solution would then be: (change the 600 to whatever maximum idle time you want)
Code:
 

#idlekicker on
 [color:red]  [/color] 
on *@!:JOIN:#needhelp: if !$timer($nick) { $+(.timer,$nick) 1 600 KickIdler $chan $nick }
on *:TEXT:*:#needhelp: $+(.timer,$nick) 1 600 KickIdler $chan $nick
alias KickIdler if ($me isop $1) && ($2 isreg $1) { ban -k $1-2 2 Idling is not allowed! }
 [color:red]  [/color] 
#idlekicker end
 


Solution 1 is less work for mIRC cuz it doesn't have to keep setting timers, but the downside is that because of the interval of the timer, you cannot make the idle time 100% strict.

Solution 2 is more work for mIRC cuz it has to set an individual timer for everyone who joins your channel, and re-set the timer for everyone who speaks. The good thing, is that the idle time will be exactly at a maximum of 600 seconds, with no interval whatsoever.

Greets

Last edited by FiberOPtics; 29/05/04 12:41 PM.

Gone.