mIRC Homepage
Posted By: Firestarter Idle Kick script - 20/09/06 09:01 PM
Hi been looking for one of these things and not found anything that works. Anyone got a good one or know where I can find one?

Thanks
Firestarter
Posted By: Lpfix5 Re: Idle Kick script *DELETED* - 20/09/06 09:34 PM
Post deleted by Lpfix5
Posted By: Lpfix5 Re: Idle Kick script - 20/09/06 10:02 PM
well i tested the script its not looping properly i dont know what im not seeing.
Posted By: RusselB Re: Idle Kick script - 20/09/06 10:29 PM
I didn't check Lpfix5's code to see if I could find why it's not working, but instead I wrote (and tested) this
Code:
 menu channel,nicklist {
  Kick Idlers : idle.kick $network $chan
  Set Allowed Idle Time : idle.time $network $chan
}
alias idle.time {
  set %idle $$?="Allowed idle time in minutes or mm:ss format"
  set $+(%,idle.time.,$1,.,$2) $iif($chr(58) isin %idle,$duration(%idle),$calc(%idle * 60))
}
alias -l idle.kick {
  set %chan $2
  if !$+(%,idle.time.,$1,.,$2) {
    idle.time $1 $2
  }
  var %a = 1
  while %a <= $nick($2,0) {
    if $nick($2,%a).idle > $($+(%,idle.time.,$1,.,$2),2) {
      .ban -ku $2 $nick($2,%a) No idling in $2
    }
    inc %a
  }
}
 
Posted By: Firestarter Re: Idle Kick script - 20/09/06 11:29 PM
Thanks RussellB works just fine, one thing though, anyway to make it automatic, so I dont wake and find loads of idlers.

Fire
Posted By: RusselB Re: Idle Kick script - 21/09/06 12:55 AM
Tried to edit my last code, but waited too long, so here's the updated
Code:
 menu channel,nicklist {
  Kick Idlers : idle.kick $network $chan
  Set Allowed Idle Time : idle.time $network $chan
  Auto Scan On : auto on $network $chan
  Auto Scan Off : auto off $network $chan
}
alias auto {
  if $1 == off {
    $+(.timer,$2,.,$3) off
  }
  else {
    if !$+(%,idle.time.,$1,.,$2) {
      idle.time $1 $2
    }
    $+(.timer,$2,.,$3) 0 $$?="Time between scans in seconds" idle.kick $network $chan}
  }
}
alias -l idle.time {
  set %idle $$?="Allowed idle time in minutes or mm:ss format"
  set $+(%,idle.time.,$1,.,$2) $iif($chr(58) isin %idle,$duration(%idle),$calc(%idle * 60))
}
alias -l idle.kick {
  set %chan $2
  if !$+(%,idle.time.,$1,.,$2) {
    idle.time $1 $2
  }
  var %a = 1
  while %a <= $nick($2,0) {
    if $nick($2,%a).idle > $($+(%,idle.time.,$1,.,$2),2) {
      .ban -ku $2 $nick($2,%a) No idling in $2
    }
    inc %a
  }
}
 


I tried to get it so that if the Automatic was ON, only the Off option would show, and vice versa, but I wasn't able to do so (although I'm pretty sure I've seen it done before, so someone else might be able to fix up my code with that option)
Posted By: Firestarter Re: Idle Kick script - 21/09/06 01:25 PM
Thanks again RusselB sadly the auto kick dont work frown but it is better than nothing and the manual way does save me looking through the log buffer to see who been idling LOL

Regards
Fire
© mIRC Discussion Forums