Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Idle Kicker

Recommended Posts

  • Administrators
This is an idle kicker that works across mulitple networks and in multiple channels. Settings are on a channel by channel basis, and are set/reset via channel menu. Settings are stored in a hash table.

Exemptions can be set based on access level (op, half-op, voice and/or regular) as well as by specific nick. NOTE: If the number of characters in the list of exempted nicks exceeds approximately 500, then an error will occur. I have not used binary variables to get around the length limitation, but if the average nick is 20 characters in length, then you still have room for about 25 nicks.

As of mIRC version 6.32, the aforementioned limit still exists, but has been greatly expanded to about 4000 characters, or 200 nicks at an average of 20 characters per nick.

Code edited per information from [85] in this topic

Also checked against recent updates in mIRC to confirm that it works with version 7.14

 

ctcp *:version:*:  ctcpreply $nick VERSION Idle Kicker 10.19.2010 by Russel Bairstow

on *:start:{

  if !$hget(idle_kick) { .hmake idle_kick 10 }

  if $exists($qt($scriptdiridlekick.hsh)) {    .hload idle_kick $qt($scriptdiridlekick.hsh)  }

  load_idle

}

on *:exit:{

  .timers off

  .hsave -o idle_kick $qt($scriptdiridlekick.hsh)

}

on *:disconnect:{

  $+(.timer,$network,*) off

  .hsave -o idle_kick $qt($scriptdiridlekick.hsh)

}

menu channel {

  Idle Kick

  .$iif(!$idle($network,$chan),Set,Reset) Allowed idle time : idle $network $chan $iif($duration($$?="Time in hh:mm:ss format. Note that hh and mm are not required and will default to 0 if not supplied") isnum,$v1,$duration($v1))

  .$iif($idle($network,$chan),Clear Idle Time $duration($idle($network,$chan),3)) : .hdel idle_kick $+($network,.,$chan,.,Idle)

  .$iif(!$exempt($network,$chan),Set,Reset) Exempt Modes: {

    var %exempt = $$?="Enter characters for exemption status (o = op, h = half-op, v = voice, r = regular)"

    var %exempt1 = $remove(%exempt,o,h,v,r)

    exempt $network $chan $remove(%exempt,%exempt1)

  }

  .$iif($exempt($network,$chan),Clear Exempt Modes $exempt($network,$chan)) : .hdel idle_kick $+($network,.,$chan,.,Exempt)

  .Exempt Nick(s) : {

    var %exempt.nicks = $replace($$?="Nick(s) to exempt",$chr(44),$chr(32))

    var %a = 1, %b = $numtok(%exempt.nicks,32)

    while %a  $idle($network,$chan),.kick $1 $nick($1,%a,a,%exempt) No idling allowed)

      inc %a

    }

  }

  else {    if ($nick($1,$2).idle > $idle($network,$chan)) {        .kick $1 $2 No idling allowed      }  }

}

alias -l load_idle {

  var %a = 1, %b = $scon(0)

  while %a 

Link to comment
Share on other sites



×
×
  • Create New...