This is a simple script to kick idlers in a channel. Someone couldn't find one that suited their needs so I made it for them. This scripts waits a given time after a user joins or talks in a channel to kick them. Only affects regular users, v/h/o/a/q not affected.
Setup:
Change #pball to your channel
Change the 30 in the second to last line to how many seconds to wait before kicking (or leave at 30 for massive lulz)
Change the kick message in the last line
on *:join:#pball: idle_timer
on *:text:*:#pball: if ($nick isreg $chan) idle_timer
on *:action:*:#pball: if ($nick isreg $chan) idle_timer
on *:part:#pball: if ($timer(idle $+ $nick)) .timeridle $+ $nick off
on *:quit: if ($timer(idle $+ $nick)) .timeridle $+ $nick off
alias idle_timer { .timeridle $+ $nick 1 30 idle_kick $chan $nick }
alias idle_kick { if ($2 ison $1) && ($2 isreg $1) kick $1 $2 Please don't idle here }
toclafane1 you seem to forget that some times channels have a specific purpose and idling in them is not what they are for. channels to request vhosts are an example, you use a command to request a vhost and then you're supposed to leave.
this isn't for regular channels where people talk, unless the owner has a twisted sense of humor lol.
pball wrote: > toclafane1 there are plenty of good reasons to kick idlers What if the person, that's "idle", is away from keyboard, and they're kicked? I think that's just not fair, if they've not done anything wrong to be kicked. Also my comment's hasn't had any value, 'cause I have no comment of value to add.
I have no idea why that regsubex shortcut is so popular when it can only support small channels. Mircs string limit is 4000 and something chars, so that script wouldn't work in a 100 user channel if everyone had nicknames only 5 characters long. A lot of nicks are longer than that, so in reality it will crap out on considerably smaller channels.
Just use a while loop. It may be longer but it's more suitable for the task at hand. We should never sacrifice functionality just to have a smaller script.
Why set a bunch of timers when you can do it with one identifier and one timer? You may not need any timer at all if you do it via an on ping event. Here is what I meant:
on *:ping:{
var %i = 1, %c
while ($comchan($me,%i)) {
if ($me isop $v1) {
%c = $v2
tokenize 32 $regsubex($str($chr(32),$nick(%c,0,r)),//g,$&
$iif($nick(%c,\n,r).idle >= 30,$iif($nick(%c,\n,r) != $me,$v1)))
kick %c $* Please don't idle here.
}
inc %i
}
}
@toclafane1
why remove the #pball? the way it's setup now is to work in 1 channel.
@Jethro
Why would my approach be ill-advised? If there are 10 normal users in a chan there would 10 timers with my method. Your method would have a single timer but have to loop through all the nicks at once. Is there that big of difference there?