mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2008
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Apr 2008
Posts: 4
Hope you can help me to solve this problem.

I want to kick a user who stays idle for 5 mins on MY CHANNEL (i.e: #myroom). I don't care this user is active on whatever channel and if he is idle for 5 mins on my channel, he'll get kicked.

Using checkidle method is not effective in this case as if a user is active on another channel, the idle time does not count.

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:

Using checkidle method is not effective in this case as if a user is active on another channel, the idle time does not count.


Why? There'd be 2 different idles, one for your channel and one for the other channel they are active in.

Code:
on @*:join:#myroom:{
  $+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
  if ($nick($2,$1).idle > 300) {
    kick $2 $1 Don't idle.
    $+(.timer,$nick) off
  }
}

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I suspect the OP was thinking of the network idle time, rather than the channel idle time, when he referred to the 'checkidle method'

I'd also like to refer the OP, and anyone else that's looking for a code like this, to my Idle Kicker which is a bit more detailed.

Joined: Apr 2008
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Apr 2008
Posts: 4
Well, I mean I just wanna kick idle users on my channel. I don't care if they're active on other channels.

I tried some methods, however, I got a bug. That is the idle users on my channel won't be kicked if they're active on other channels. Now the code above helped me alot.

HOWEVER, I still have a problem, that is, the users who have chanel voice (+v) or op (+o) won't be affected by this code, so can you help me?

Last edited by mrsilent; 11/04/08 01:37 PM.
Joined: Feb 2003
Posts: 83
L
Babel fish
Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
Originally Posted By: SladeKraven
[quote]

Code:
on @*:join:#myroom:{
  $+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
 if ($1 !isreg $2) { $+(.timer,$nick) off }
  if ($nick($2,$1).idle > 300) {
    kick $2 $1 Don't idle.
   $+(.timer,$nick) off 
  }
}


That should do it for you. Enjoy.


any help would make me happy
Joined: Apr 2008
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Apr 2008
Posts: 4
Code:
on @*:join:#help:{
  $+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
 [color:#FF6666] if ($1 !isreg $2) { $+(.timer,$nick) off }[/color]  if ($nick($2,$1).idle > 300) {
    ban -u900 $2 $1 2 | sapart $1 $2
    $+(.timer,$nick) off
  }
}


I inserted that new line above already, however, it makes no difference from the old one.

What I want here is that, a code to kick idle user on my channel (i.e. #myroom) and make sure that this code doesn't affect channel ops and voices (it will kick normal idle users only, ops (+o) and voices (+o) are not kicked).

What do you mean by this: if ($1 !isreg $2) ?

Last edited by mrsilent; 11/04/08 06:13 PM.
Joined: Feb 2003
Posts: 83
L
Babel fish
Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
Code:
on @*:join:#help:{
  $+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
 if ($1 !isreg $2) { $+(.timer,$1) off | return }
  if ($nick($2,$1).idle > 300) {
    ban -u900 $2 $1 2 | sapart $1 $2
    $+(.timer,$1) off
  }
}


Sorry. That should fix my error (and SladeKraven's). i forgot to stop the script from proceeding after halting the timer.
Originally Posted By: mrsilent

What do you mean by this: if ($1 !isreg $2) ?

$1 represents the nick
$2 represents the channel
!isreg represents user that is not @ or + on the channel

if (Nick !isreg Channel) { $+(.timer,Nick) off | return }

Hope this helps. smile


any help would make me happy
Joined: Jan 2008
Posts: 22
I
Ameglian cow
Offline
Ameglian cow
I
Joined: Jan 2008
Posts: 22
Originally Posted By: LO_KEY
Code:
on @*:join:#help:{
  $+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
 if ($1 !isreg $2) { $+(.timer,$1) off | return }
  if ($nick($2,$1).idle > 300) {
    ban -u900 $2 $1 2 | sapart $1 $2
    $+(.timer,$1) off
  }
}


Sorry. That should fix my error (and SladeKraven's). i forgot to stop the script from proceeding after halting the timer.
Originally Posted By: mrsilent

What do you mean by this: if ($1 !isreg $2) ?

$1 represents the nick
$2 represents the channel
!isreg represents user that is not @ or + on the channel

if (Nick !isreg Channel) { $+(.timer,Nick) off | return }

Hope this helps. smile

instead of if ($nick !isreg $chan) {
it should be if ($nick isreg $chan) { <-- this wont affect ops/voices

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The script that I referred you to allows you to decide who (if anyone) is exempt from the idle kick on a channel by channel basis. If you only want it active on one channel, then right click in that channel, and use the menu to set the allowed idle time, as that is set on a channel by channel basis.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Wrong. It was correct using !isreg. If you look, it will RETURN (i.e. halt) the script if the person !isreg. That's what the OP wants to happen. If you remove the !, you'll only be kicking ops and voices (and any other modes the network supports).


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2008
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Apr 2008
Posts: 4
Thank for your contribution very much!

However, I still wanna have the last help, that is, whenever I (myself) join #myroom, I want to scan all existing users on #myroom. If anyone has been idle for equal or more than 5 mins, he will be kicked. Of course, channel ops and voices are exempt.

I'm happy to have your answer

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Add this 'appendix' to your script:
Code:
; joining "your" channel - start the idle-check after 300 seconds
on me:*:join:#help: { .timeridlecheck.init 1 300 if ( $!me isop $chan ) idlecheck.init $chan } 

; loop all regular users to perform the idle-check
; (using the nick-count to prevent possible kick-flood)
alias -l idlecheck.init {
  var %nr = 1
  while ($nick($1,%nr,r)) {
    .timer 1 $calc(%nr *2) idlecheck $v1 $1
    inc %nr
  }
}
smile

Edit / Note: As mIRC is starting to count the idle-duration of the channels users on YOUR join, I set the initial check straight 5 minutes after your join. There's no way to evaluate "previous" idling in your absence.

Last edited by Horstl; 12/04/08 09:48 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
Edit / Note: As mIRC is starting to count the idle-duration of the channels users on YOUR join, I set the initial check straight 5 minutes after your join. There's no way to evaluate "previous" idling in your absence.
A method that might be used to get some of the people, is to whois the people on the channel and check raw 317 for their network idle time.. if their network idle time is greater than 5 minutes, then their channel idle time has to be greater than that also.

To the OP: If you make use of this information, I recommend you do so carefully, as multiple whois' in a short period of time can flood you off of the network.


Link Copied to Clipboard