mIRC Homepage

idle kicker

Posted By: sCHuTt

idle kicker - 05/11/04 02:13 PM

Code:
on *:text:*:#channel:if $nick = usernick { /timerusernick stop 
/timerusernick $+ # 1 1800  { /ban -u10 #channel usernick
/kick #channel usernick talk instead off lurk an log ffs... } }

so when a usernick speaks 1 line, a counter resets, if he dun talk for 30 minutes after that, the bot kickbans him...

Do-able?

- §CHuTt
Posted By: whatsthedillio

Re: idle kicker - 05/11/04 02:22 PM

use
$nick($chan,nick).idle
to see a nicks idle time
and maybe use a small loop
to check and ban them
-
alias checkidlers {
var %i = 1
while (%i != $nick(#chan,0)) {
if ($nick(#chan,%i).idle > 3000) {
mode #chan +b $address($nick,1)
kick #chan $nick MESSAGE
}
inc %i
}
}

use a timer to run the alias

use the search
aswell cuz im sure this will be there
wink
Posted By: LocutusofBorg

Re: idle kicker - 05/11/04 02:27 PM

There are several ways to go about this. One is using a timer, but that can be kinda hard when there's a lot of people in your channel. For not too many people, there's no problem. The code below will start a timer prompting the user's removal
everytime he sends text to a channel in any way. The kbnick alias is used so you can check if the user's still there when you want to kick him. You could of course disable timers when the user parts/quits/gets kicked, but this is simple enough. Just change the parts in blue.

Code:
on *:TEXT:*:[color:blue]#channelname[/color]: .timer [ $+ [ $nick ] ] 1 1800 kbnick $chan $nick
on *:ACTION:*:[color:blue]#channelname[/color]: .timer [ $+ [ $nick ] ] 1 1800 kbnick $chan $nick
on *:NOTICE:*:[color:blue]#channelname[/color]: .timer [ $+ [ $nick ] ] 1 1800 kbnick $chan $nick
[color:blue] [/color]
alias kbnick { if ($2 ison $1) && ($me isop $1) ban -ku60 $1 $2 3 Idle time exceeding 30 minutes. }


For bigger channels, it would perhaps be better (not easier) to manually store the last time someone sent text to the channel in a hash table, and then loop through that table every minute or so, removing those users that idled too long.

Of course the loop through the nicklist works too...
Posted By: Armada

Re: idle kicker - 05/11/04 07:47 PM

If I remember correctly you hate timers you say they are cpu intensive so why run a timer for each user when a simple loop would be better?
Posted By: LocutusofBorg

Re: idle kicker - 07/11/04 08:23 AM

I was quite clear they should only be used when there's a small amount of people. I don't hate timers. And because that setup is far easier than the loop.
© 2021 mIRC Discussion Forums