Idle kicker

By anthalus on Dec 20, 2005

Just a simple idle kicker. It will kick anyone other than ops and halfops who have idled longer than you set the check for.

;===Idle Checker===;

alias check.idle {
  var %chan = $1
  if ( %i.limit [ $+ [ $1 ] ] == 0 ) {
    .echo 4 -a Idle Check is not set for this #channel
    return
  }
  var %nick = $nick(%chan,0,a,oh)
  while (%nick) {
    if ( $nick(%chan,%nick,a,oh).idle != $me ) {
      if ( $nick(%chan,%nick,a,oh).idle > %i.limit ) {
        .kick %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit 
      }
    }
    dec %nick
  }
}

menu channel {
  -
  Idle Limiter
  .Set :set %i.limit [ $+ [ $chan ] ] $$?="Idle limit? (60 = 1 minute) "
  .Reset :unset %i.limit [ $+ [ $chan ] ]
  .Check:check.idle $chan
  -
}

Comments

Sign in to comment.
Lenooox   -  Apr 03, 2012

do not want to hurt you, I just noted :$ I apologize :(

 Respond  
Pangaea   -  Apr 03, 2012

well .. pift .. i dunno i added the bloody things in

 Respond  
Pangaea   -  Apr 03, 2012

i didnt want ppl thinking it was on piece of code.... i guess i could code each one.. argh

 Respond  
Lenooox   -  Apr 03, 2012

ohh damn so annoying not to use the [ code ] ...... [ /code ] thing :$

 Respond  
Pangaea   -  Apr 03, 2012

is there anyway to make this de-voice rather then kick.. spent the last hour trying things, haven't a clue what im doing

i tried changing this line :
[ code ] .kick %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]

to

[ code ] -v %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] mode -v %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] .mode -v %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] -v $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] mode -v $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] .mode -v $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] .-v %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] .devoice %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] .devoice $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] devoice %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] devoice $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]
[ code ] mode .devoice %chan $nick(%chan,%nick,a,oh) Idle Time Limit is : %i.limit [ /code ]

.....bleh bleh bleh..etc etc
could be here all year tbh

anyone any ideas? or is it even possible to change the script to make it devoice not kick?

regards
pan

 Respond  
Jethro   -  Aug 01, 2010

My mistake. I forgot to add the kick message.

 Respond  
Jethro   -  Aug 01, 2010

Cheiron, use this version instead. Since you're to mainly kick for regular idlers. You can simply use the r. I also added a channel settings so you can choose which channel to watch out for idlers. If no channel specified, the script will kick them on the channel where you are:

menu * {
  -
  Idle Limit Settings
  .Set Channel {
    set %i.chan $$?="What Channel? (#channel) "
  }
  .Set Limit for Idling {
    set %i.limit $$?="Idle limit? (60 = 1 minute) "
  }
  .Reset the Idle Limit {
    unset %i.limit
    notice $me idle time limit has been unset.
  }
  .Turn Idle Check On {
    .enable #idlecheck
    echo -a * Auto-Idle Check Has Been Turned On
    .timeridle 0 10 idlecheck
  }
  .Turn Idle Check Off {
    .disable #idlecheck
    echo -a * Auto-Idle Check Has Been Turned Off
    .timeridle off
  }
  -
}
#idlecheck on

#idlecheck end
alias -l idlecheck {
  var %ci = $iif($(,%i.chan),$v1,#)
  tokenize 32 $remtok($regsubex($str(.,$nick(%ci,0,r)),/./g,$&
    $iif($nick(%ci,\n,r).idle > $iif($(%i.limit,2),$v1,1800),$&
    $nick(%ci,\n,r)) $chr(32)),$me,32) 
  kick %ci $* Idle Time Limit is $iif($(,%i.limit),$v1,1800) seconds.
}

P.S. You should think about banning them for a minute or two. They can easily rejoin the channel and idle again. And that'll be nonstop. If you want, you can change the kick bit to this one:

ban -ku120 %ci $* 2 Idle Time Limit is $iif($(,%i.limit),$v1,1800) seconds.

This will ban their hosts for 2 minutes before they can come back.

 Respond  
Cheiron   -  Aug 01, 2010

thankies :)

 Respond  
Jethro   -  Aug 01, 2010

Deleted.

 Respond  
Cheiron   -  Aug 01, 2010

var %nick = $nick(%chan,0,a,ohv~&)

like that ?

the bot is halfop btw in channel.

 Respond  
Jethro   -  Aug 01, 2010

Because you have an extra, unneeded comma. Remove the comma and the code should look like this:

var %nick = $nick(%chan,0,a,ohv)

On a side note, you should add:> ~&after the letter v so it excludes admins and owners.

 Respond  
Cheiron   -  Aug 01, 2010

went to add voice to it .. so it only kicked regular users and got this

* Invalid parameters: $nick (line 9, script36) that line is .. var %nick = $nick(%chan,0,a,oh,v) i added the v to it to ignore voice. where did i go wrong lol.
 Respond  
SnoooP   -  Nov 15, 2009

add a post in the script request forum and im sure somebody will do it for you.

 Respond  
macollins2   -  Nov 14, 2009

I am not a script writer, i come to hawkee for ideas to use for scripts to add to my bot. I really like this script however, I just want to add a script that will continually check idle time on nicks in channel and not kick or ban. I prefer the ops to do so if needed rather than automated. Can someone help me?

 Respond  
Linuxuser   -  Feb 17, 2009

hmm
this script seens slighty too long couldn't it be made smallerlike this:

alias idle { set %idle 900
var %nick = $nick(%chan,0,a,oh)
while (%nick) {
if ( $nick(%chan,%nick,a,oh).idle != $me ) {
if ( $nick(%chan,%nick,a,oh).idle > %i.limit ) {
ban -ku180 # $nick idle time exceeded!!!
unset %nick
unset %idle }
}
}
}

 Respond  
Lindrian   -  Feb 01, 2007

What about making it respond in minutes instead of seconds? %i.limit * 60

 Respond  
scplay   -  Feb 01, 2007

This doesn\'t respond at all.

 Respond  
hitman25   -  Jul 31, 2006

ok first time posting to this and i am real new and trying to teach myself how to write these and where to put them. so if anyone can help or just give me a push in the right direction i would greatly thank you.

like this one i put it in a bot but im not sure if i put it in the right spot and were do you change the time at?

 Respond  
anthalus   -  Feb 08, 2006

Yeah, what Corne said.

Forgot it was for a bot when I did the on Text and such. This is what happens when you are doing chaos math and replying here :)

 Respond  
Corne   -  Feb 03, 2006

\'on @:TEXT:!idler:?:\' wont work ... it should be \'check.idle $2\' and if you wanna check if the nickname is @ in the channel he wants to check the users\' idle, it should be \'if $nick isop $2...\' not on @*:text....

 Respond  
anthalus   -  Feb 03, 2006

It is already set to kick voices and normals. I excluded ops and halfops from being kicked.

For a bot:

on @:TEXT:!idler:?: {
.check.idle $1
}

Just message the bot with the room name and if it has ops, it will perform the check.

!idler #roomname

 Respond  
jacobhunter   -  Jan 18, 2006

sorry for the double

 Respond  
jacobhunter   -  Jan 18, 2006

How would i make this to kick voices and normals only and can it be put in a bot.

 Respond  
jacobhunter   -  Jan 18, 2006

I have a question how would it make it kick only vocied and normals?

 Respond  
xDaeMoN   -  Jan 08, 2006

Change the \"while(%nick)\" part to \"while (%nick)\".

 Respond  
Yoinx   -  Jan 08, 2006

you need a space between while and (

 Respond  
dark^scorpian   -  Jan 08, 2006

i have tried it adn keep getting the following error:

WHILE(%NICK) Unknown command

am using mirc 6.16

any ideas?

tnx

 Respond  
SnoooP   -  Jan 02, 2006

its useful :)

 Respond  
Raichu   -  Dec 21, 2005

U should addup some:

.Set
..5 minutes
..10 minutes
..20 minutes
..30 minutes

I dont see alot of ppl calculating it if they are new. Even if u said its 60 = 1 minutes.

 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.