mIRC Home    About    Download    Register    News    Help

Print Thread
idle kicker #102166 05/11/04 02:13 PM
Joined: Aug 2004
Posts: 21
S
sCHuTt Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2004
Posts: 21
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

Re: idle kicker #102167 05/11/04 02:22 PM
Joined: Jun 2004
Posts: 291
W
whatsthedillio Offline
Fjord artisan
Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

Last edited by whatsthedillio; 05/11/04 02:23 PM.
Re: idle kicker #102168 05/11/04 02:27 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
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...


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: idle kicker #102169 05/11/04 07:47 PM
Joined: Mar 2004
Posts: 540
A
Armada Offline
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
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?

Re: idle kicker #102170 07/11/04 08:23 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
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.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius