/* * Some stuff for channels operators * * Author: Emanuele Magrin aka MADagency * Based on teknap script by Brian Weiss aka Fudd */ assign AUTO_MUZZLE 1 assign AUTO_KICK 0 assign AUTO_MUZZLE_TIME 60 assign OPERVIEW_SIZE 5 /* This display on current channel that you have muzzled/kicked someone */ assign PUB_OPMSG 0 /* Toggle auto-muzzle on/off */ alias automuzzle (arg, void) { switch ($arg) { (0) {^assign AUTO_MUZZLE 0} (1) {^assign AUTO_MUZZLE 1} (off) {^assign AUTO_MUZZLE 0} (on) {^assign AUTO_MUZZLE 1} (*) {@ AUTO_MUZZLE = AUTO_MUZZLE ? [0] : [1]} } if ((AUTO_KICK) && (AUTO_MUZZLE)) { ^assign AUTO_KICK 0 }{ } @ status_prot() } alias autokick (arg, void) { switch ($arg) { (0) {^assign AUTO_KICK 0} (1) {^assign AUTO_KICK 1} (off) {^assign AUTO_KICK 0} (on) {^assign AUTO_KICK 1} (*) {@ AUTO_KICK = AUTO_KICK ? [0] : [1]} } if ((AUTO_MUZZLE) && (AUTO_KICK)) { ^assign AUTO_MUZZLE 0 }{ } @ status_prot() } alias Pubact (arg, void) { switch ($arg) { (0) {^assign PUB_OPMSG 0} (1) {^assign PUB_OPMSG 1} (off) {^assign PUB_OPMSG 0} (on) {^assign PUB_OPMSG 1} (*) {@ PUB_OPMSG = PUB_OPMSG ? [0] : [1]} } xecho -b $cparse(%rOperator public messages is ${PUB_OPMSG ? [ACTIVED] : [DISACTIVED]}) } /* The operview function is the same on the script by Fudd */ alias operview (void) { if (!OPERVIEW) { ^window new size $OPERVIEW_SIZE name ov level server fixed on last ^assign OPERVIEW 1 xecho -b OperView [ON] }{ ^window refnum ov kill ^assign -OPERVIEW xecho -b OperView [OFF] } } alias ov operview alias chankick (nick, reason) { if (nick) { /msg chanserv kick $C $nick \"${reason ? reason : [why kicked? think about it...]}\" if (PUB_OPMSG){raw 824 $C \"has kicked $nick out of channel $C : ${reason ? reason : [why kicked? think about it...]}\"} }{ xecho -b $cparse(%cUsage: /chankick [reason]) xecho -b $cparse(%c /chk [reason]) xecho -b $cparse(%c - Shortcut to kick out of your current channel) xecho -b $cparse(%c Note: if [reason] is not specificated, a standard reason is displayed) } } alias chk chankick alias operlist { ^set FLOOD_WARNING OFF /msg chanserv op $C ^set FLOOD_WARNING ON } alias ol operlist alias tmuzzle (time, nick, reason) { if (time && nick) { /msg chanserv muzzle $C $nick \"${reason ? reason : [Temporary muzzle for $time seconds]}\" if (PUB_OPMSG){raw 824 $C \"has muzzled $nick on channel $C for $time seconds: ${reason ? reason : [why muzzled? think about it...]}\"} timer $time /msg chanserv unmuzzle $C $nick }{ xecho -b $cparse(%cUsage: /tmuzzle [reason]) xecho -b $cparse(%c - Muzzles for on current channel) } } alias status_prot (void) { xecho -b $cparse(%rAnti-flood protections status:) xecho -b $cparse(%rAuto-muzzle: ${AUTO_MUZZLE ? [ACTIVE] : [NOT ACTIVE]} - $AUTO_MUZZLE_TIME seconds) xecho -b $cparse(%rAuto-kick: ${AUTO_KICK ? [ACTIVE] : [NOT ACTIVE]}) return 1 } on #^flood 421 "% PUBLIC *" { if (AUTO_MUZZLE) { ^assign chan $2 ^assign nick $0 ^assign type $1 if (finditem(pubflood $nick) < [0]) { @ setitem(pubflood $numitems(pubflood) $nick) whois -cmd { switch ($tr(/"//$1)) { (Elite) {#} (Admin) {#} (Moderator) {#} (*) { xecho -b $cparse(%yPUBLIC flooding detected from $nick on $chan - Muzzling for $AUTO_MUZZLE_TIME seconds) /m chanserv muzzle $chan $nick \"Auto-muzzle for $AUTO_MUZZLE_TIME seconds: flood\" if (PUB_OPMSG){raw 824 $C \"auto-muzzler has muzzled $nick on channel $C for $AUTO_MUZZLE_TIME: flood\"} timer $AUTO_MUZZLE_TIME eval /m chanserv unmuzzle $chan $nick;@ delitem(pubflood $finditem(pubflood $nick)) } } } $nick } wait -cmd @ chan = nick = type = [] } if (AUTO_KICK) { ^assign chan $2 ^assign nick $0 ^assign type $1 if (finditem(pubflood $nick) < [0]) { @ setitem(pubflood $numitems(pubflood) $nick) whois -cmd { switch ($tr(/"//$1)) { (Elite) {#} (Admin) {#} (Moderator) {#} (*) { xecho -b $cparse(%yPUBLIC flooding detected from $nick on $chan - Kicking out of channel $chan) /m chanserv kick $chan $nick \"Auto-kicked out of channel $chan: flood\" if (PUB_OPMSG){raw 824 $C \"auto-kicker has kicked $nick out of channel $C: flood\"} @ delitem(pubflood $finditem(pubflood $nick)) } } } $nick } wait -cmd @ chan = nick = type = [] } } alias oh operhelp alias operhelp { xecho -b Help for OperScript 0.1 - Madagency xecho -b ------------------------------------------------------------- xecho -b This script provides the following functions: xecho -b * Flood protection * Oper window xecho -b * Time muzzle * Channel kicker xecho -b * Action public display * Convenient shortcuts xecho -b xecho -b Commands: xecho -b /automuzzle -----> active/disactive muzzle on flood xecho -b /autokick -----> active/disactive kick on flood xecho -b /status_prot -----> display the protection status xecho -b /ov /operview -----> active/disactive oper window xecho -b /tmuzzle [reason] -----> time muzzler xecho -b /chankick [reason] -----> channel kicker xecho -b /chk [reason] -----> channel kicker xecho -b /pubact -----> active/disactive public oper messages xecho -b /operlist /ol -----> display active ops on channel xecho -b /operhelp /oh -----> this window xecho -b }