Idle kicker

By pball on Jan 10, 2012

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 }

Comments

Sign in to comment.
Stewie1k94   -  Jan 18, 2012

Yes, I know what you mean, I have not been in channels that kick for being idle.

 Respond  
pball   -  Jan 18, 2012

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.

 Respond  
Stewie1k94   -  Jan 18, 2012

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.

 Respond  
blackvenomm666   -  Jan 11, 2012

i have a script kinda like this on my bot that i made to atuo demod mods that are idle and also one to give mod to random people who aren't idle if there is less than a certain ammount of mods in the channel. mine uses a while loop though

 Respond  
Jethro   -  Jan 11, 2012

hixxy, you have a point. It can easily be converted into a while loop. I was just demonstrating what I meant is all as a friendly comment.

 Respond  
pball   -  Jan 11, 2012

toclafane1 there are plenty of good reasons to kick idlers and no i'm not gonna list them. I'm also gonna say your comments haven't added anything of value yet.

 Respond  
Stewie1k94   -  Jan 11, 2012

I think kicking people for being idle is rude...

 Respond  
hixxy   -  Jan 11, 2012

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.

 Respond  
Jethro   -  Jan 10, 2012

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
  }
}
 Respond  
pball   -  Jan 10, 2012

toclafane1 I say to change the chan in the description

Conscious I also say to change the time in the description

So your points are quite moot, I put those values in there as defaults and place holders.

 Respond  
Conscious   -  Jan 10, 2012

Idle kick on 30 seconds? Why don't people like idling? It's 30 secs, the approximate time to get a glass of water. :|

 Respond  
Stewie1k94   -  Jan 10, 2012

And that channel, is set as your channel.

 Respond  
pball   -  Jan 10, 2012

@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?

 Respond  
Stewie1k94   -  Jan 10, 2012
on *:join:#pball:{

You might want to remove the "#pball"

 Respond  
Jethro   -  Jan 10, 2012

You should check out the identifier:

$nick($chan,$nick).idle

Then use the > operator to see if people are idle longer than the idle allowance. Your approach is not well-advised.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.