mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 4
G
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Aug 2003
Posts: 4
Hi,
I need some help with an idea i have. I need a script that checks users on join and if they stay idle for more than 5 minutes after join, they're kicked with a reason.

example:

dummy joined #test <- here the scripts starts keeping track of user.
..
..
..
dummy was kick from #test: start talking < 5 minutes later he gets kicked because of inactivity in the first 5 minutes after join.

if dummy had started to speak after join, the script ignores him the rest of his stay.

is this possible? if yes, how would the script look? smile

thanks in advance smile


---------------
"To error is human; to really f*ck up requires root."
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on *@!:join:#:{ .timeridle [ $+ [ $chan [ $+ [ $nick ] ] ] ] 0 1 checkidle $chan $nick }
on *:text:*:#:{
  if $timer(idle [ $+ [ $chan [ $+ [ $nick ] ] ] ]) { .timeridle [ $+ [ $chan [ $+ [ $nick ] ] ] ] off }
}
alias checkidle {
  if $nick($1,$2).idle &gt; 300 { kick $1-2 Inactivity. }
}


- Untested.


New username: hixxy
Joined: Aug 2003
Posts: 4
G
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Aug 2003
Posts: 4
weird..Fiberoptics also made a reply but where is his post??

anyway - tidy_trax: your script did not work completely. it still kicks people if they speak.

Fiberoptics made this reply (and it seems to work):

Quote:
Hi,

one of the various possibilities is the following:
#idlekicker on
on *!:JOIN:#mychannel: .timer $+ $nick 1 300 KickIdler $nick on *:TEXT:*:#mychannel: if $timer($nick) { .timer $+ $nick off }

alias KickIdler {
var %a = #mychannel
if (($me isop %a) || ($me ishop %a)) &amp;&amp; ($1 ison %a) { kick %a $1 Start talking! } }
#idlekicker end

Just change #mychannel to whatever channel you want this to run in.

Greetz


---------------
"To error is human; to really f*ck up requires root."
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

one of the possibilities is the following. Note that is almost the same as tidy_trax example, but with a bit more error checking, and shorter code:
Code:
 
on *@!:JOIN:#: $+(.timer,idle,$chan,$nick) 1 300 KickIdler $chan $nick
on *:TEXT:*:#: if $timer($+(idle,$chan,$nick)) { $+(.timer,idle,$chan,$nick) off }
alias KickIdler if (($me isop $1) || ($me ishop $1)) &amp;&amp; ($2 ison $1) { kick $1 $2 Start talking! }

As it is possible that u are deoped at some time while there are still timers running, the alias KickIdler checks to see if you are an op or hop. Note that the ON DEOP event could be used, so that it would stop all timers involving idlers, however, I chose to not use this option, as I assume that you'll get oped again fast, after a possible deop (due to whatever reason).

The alias also checks if the nick is still on the channel. Cuz it is possible that a nick parts or quits, before the timer is triggered, thus it would result in the script trying to kick a nick that is not on the channel anymore.

Hope this works out for you,

Greetz

Edit: to the original poster, i deleted my first reply, as my script was more or less the same as tidy_trax's...however I did decide to post now, cuz of the reasons mentioned in the introduction.

Last edited by FiberOPtics; 23/05/04 12:02 AM.

Gone.
Joined: Aug 2003
Posts: 4
G
Self-satisified door
OP Offline
Self-satisified door
G
Joined: Aug 2003
Posts: 4
it works great - thx smile


---------------
"To error is human; to really f*ck up requires root."
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You're welcome!

Bye


Gone.

Link Copied to Clipboard