This is an idle kicker that works across mulitple networks and in multiple channels. Settings are on a channel by channel basis, and are set/reset via channel menu. Settings are stored in a hash table.
Exemptions can be set based on access level (op, half-op, voice and/or regular) as well as by specific nick. NOTE: If the number of characters in the list of exempted nicks exceeds approximately 500, then an error will occur. I have not used binary variables to get around the length limitation, but if the average nick is 20 characters in length, then you still have room for about 25 nicks.
As of mIRC version 6.32, the aforementioned limit still exists, but has been greatly expanded to about 4000 characters, or 200 nicks at an average of 20 characters per nick.
Code edited per information from [85] in this topic
Also checked against recent updates in mIRC to confirm that it works with version 7.14
ctcp *:version:*: ctcpreply $nick VERSION Idle Kicker 10.19.2010 by Russel Bairstow
on *:start:{
if !$hget(idle_kick) { .hmake idle_kick 10 }
if $exists($qt($scriptdiridlekick.hsh)) { .hload idle_kick $qt($scriptdiridlekick.hsh) }
load_idle
}
on *:exit:{
.timers off
.hsave -o idle_kick $qt($scriptdiridlekick.hsh)
}
on *:disconnect:{
$+(.timer,$network,*) off
.hsave -o idle_kick $qt($scriptdiridlekick.hsh)
}
menu channel {
Idle Kick
.$iif(!$idle($network,$chan),Set,Reset) Allowed idle time : idle $network $chan $iif($duration($$?="Time in hh:mm:ss format. Note that hh and mm are not required and will default to 0 if not supplied") isnum,$v1,$duration($v1))
.$iif($idle($network,$chan),Clear Idle Time $duration($idle($network,$chan),3)) : .hdel idle_kick $+($network,.,$chan,.,Idle)
.$iif(!$exempt($network,$chan),Set,Reset) Exempt Modes: {
var %exempt = $$?="Enter characters for exemption status (o = op, h = half-op, v = voice, r = regular)"
var %exempt1 = $remove(%exempt,o,h,v,r)
exempt $network $chan $remove(%exempt,%exempt1)
}
.$iif($exempt($network,$chan),Clear Exempt Modes $exempt($network,$chan)) : .hdel idle_kick $+($network,.,$chan,.,Exempt)
.Exempt Nick(s) : {
var %exempt.nicks = $replace($$?="Nick(s) to exempt",$chr(44),$chr(32))
var %a = 1, %b = $numtok(%exempt.nicks,32)
while %a <= %b {
.hadd -m idle_kick $+($network,.,$chan,.,Exempt.Nick) $addtok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$gettok(%exempt.nicks,%a,32),32)
inc %a
}
}
.Manual Check : check_idle $chan
}
on *:op:#:{
if $opnick == $me {
var %exempt = $hget(idle_kick,$+($network,.,$chan,.,Exempt)), %a = 1, %b = $nick($chan,0,a,%exempt)
while %a <= %b {
if !$istok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$nick($chan,%a,a,%exempt),32) {
$+(.timer,$network,.,$chan,.,$nick($chan,%a,a,%exempt)) -m 0 500 check_idle $chan $nick($chan,%a,a,%exempt)
}
inc %a
}
}
if o isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$opnick)) { $+(.timer,$network,.,$chan,.,$opnick) off }
}
on *:help:#:{
if h isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$hnick)) { $+(.timer,$network,.,$chan,.,$hnick) off }
}
on *:voice:#:{
if v isin $exempt($network,$chan) && $timer($+($network,.,$chan,.,$vnick)) { $+(.timer,$network,.,$chan,.,$vnick) off }
}
alias -l exempt {
if $isid { return $hget(idle_kick,$+($network,.,$chan,.Exempt)) }
else { .hadd -m idle_kick $+($1,.,$2,.Exempt) $3 }
}
alias -l idle {
if $isid { return $hget(idle_kick,$+($1,.,$2,.Idle)) }
else { .hadd -m idle_kick $+($1,.,$2,.Idle) $3 }
}
alias -l check_idle {
if !$2 {
var %exempt = $exempt($network,$1), %a = 1, %b = $nick($1,0,a,%exempt)
while %a <= %b {
.timer 1 %a $iif($nick($1,%a,a,%exempt).idle > $idle($network,$chan),.kick $1 $nick($1,%a,a,%exempt) No idling allowed)
inc %a
}
}
else { if ($nick($1,$2).idle > $idle($network,$chan)) { .kick $1 $2 No idling allowed } }
}
alias -l load_idle {
var %a = 1, %b = $scon(0)
while %a <= %b {
.scon %a
var %c = 1, %d = $chan(0)
while %c <= %d {
var %exempt = $exempt($network,$chan(%c)), %e = 1, %f = $nick($chan(%c),0,a,%exempt)
while %e <= %f {
$+(.timer,$network,.,$chan(%c),.,$nick($chan,%e,a,%exempt)) -m 0 500 check_idle $chan $nick($chan(%c),%e,a,%exempt)
inc %e
}
inc %c
}
inc %a
}
}
on *:quit:{
$+(.timer,$network,*,$iif($nick != $me,$nick)) off
}
on *:part:#:{
if $nick == $me { $+(.timer,$network,.,$chan,*) off }
elseif $timer($+($network,.,$chan,.,$nick)) { $+(.timer,$network,.,$chan,.,$nick) off }
}
on *:kick:#:{
if $knick == $me { $+(.timer,$network,.,$chan,*) off }
elseif $timer($+($network,.,$chan,.,$knick)) { $+(.timer,$network,.,$chan,.,$knick) off }
}
on @*:join:#:{
if !$istok($hget(idle_kick,$+($network,.,$chan,.,Exempt.Nick)),$nick,32) {
$+(.timer,$network,.,$chan,.,$nick) -m 0 500 check_idle $chan $nick
}
}
For all those that are looking watching these comments and having trouble with the code, I'm not exactly sure what changed, but something changed in the mIRC executable that made the script stop working properly. I am in the process of re-writing the script and will test it both by myself and with others over several different versions of mIRC. Hopefully I'll be able to come up with a single code that will work in all versions after 6.16
I'm limiting the testing to versions after 6.16 simply due to the age of that version.
I have put it into remotes and I get * /timer: timer 2 not active
when tring to check naully and the auto check doesn't work
and its not saving the setting
what am I doing wrong
I notice on reboot I am getting
/hsave: insufficient parameters (line 13, scriptdiridlekick.ini)
I will try this script but what I am really looking for is a "Guest nick Idle kicker". I do not mind idlers at all, however I do mind idlers that do not change from a guest nick. I have jpirc applet users coming into channel who will park without changing nicks. Pretty soon I have a list full of guest nicks. It drives me nuts!!
So make this same script but designate it to kick guests only who idle over a designated time while still protecting ops, vops, halfops, and all other nicks who are not "guest##"
then Id love ya to death RusselB...
oh, I love ya anyway
DeeperStill
Later**** I tested this out in my irc channel. I set it to kick idlers at 30 minutes. It didn't work. Should I have placed it some other place besides "remotes"?
As stated, this was originally written when I got requests from channel owners to keep people from idling in their channels. Due to the number of requests I got, I figured I might as well post the code here and be able to refer them to this location.
I understand where you're coming from, PATX & hy71194, in regards to many people idling in channels, but if the channel owner doesn't want idlers, then they shouldn't have to put up with them.
BTW: I don't guarantee that all of my scripts will work 100%, but I do guarantee that I will do my best to fix any bugs found.
RusselB is amongst the most respected coders i have come to know Patx. every script he does is guarenteed 100% to be a worker and coded in probably the most professional way possible. these scripts are aimed at those people that require these scripts.
to say that it is flawed would require significant evidence that the code is flawed , that it doesnt work and that it doesnt do what it is was coded to do.
ok with some testing, I moved the alias Check_idle to the top of the code and took out the -l ...but now it just seems to have a problem if i set the idle limit above 2 mins. I get this:
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active
* /timer: timer 1 not active