mIRC Home    About    Download    Register    News    Help

Print Thread
G
GhostCom
GhostCom
G
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

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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.

G
GhostCom
GhostCom
G
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

Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
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.
G
GhostCom
GhostCom
G
it works great - thx smile

Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
You're welcome!

Bye


Link Copied to Clipboard