/* * Some stuff for Moderators+ * Author: Brian Weiss * Last modified: 4/24/02 * * This script uses the serial numbers 0 and 424. */ /*** CONFIG SECTION ***/ assign AUTO_MUZZLE 1 assign AUTO_MUZZLE_TIME 60 assign OPERVIEW_SIZE 5 /*** END CONFIG SECTION ***/ alias ov operview alias tmuzzle tempmuzzle /* * /AUTOMUZZLE [0|1|OFF|ON] * Toggle auto-muzzle ON/OFF */ alias automuzzle (arg, void) { switch ($tolower($arg)) { (0) (off) {^assign AUTO_MUZZLE 0} (1) (on) {^assign AUTO_MUZZLE 1} (*) {@ AUTO_MUZZLE = AUTO_MUZZLE ? [0] : [1]} } xecho -b Auto-muzzle has been ${AUTO_MUZZLE ? [activated] : [de-activated]} } /* * /CLEVEL [0|1|2|3|4] * Changes the level of the current channel. */ alias clevel (level, void) { switch ($level) { (0) {//setchanlevel $C leech} (1) {//setchanlevel $C user} (2) {//setchanlevel $C moderator} (3) {//setchanlevel $C admin} (4) {//setchanlevel $C elite} (*) { xecho -b Usage: /clevel xecho -b - Sets channel level to xecho -b - can be any numbered between 0 and 4 xecho -b - leech(0)/user(1)/moderator(2)/admin(3)/elite(4) } } } /* * /CLONES [server] [maxclones] * All-purpose clone checker. Uses /GUSERS output to check for clones above * the specified [maxclones] (default: 2) existing on [server]. * User classes > 1 will be ignored. */ alias clones (server default "*", max_clones default "2", void) { @ cleanup.clonechk() @ CLONES.MAX = max_clones @ CLONES.SERVER = server /* * End of /gusers output. This is where the actual search for clones * takes place. */ ^on ^831 "*" { for (@ :cnt = [0], cnt < numitems(users), @ cnt++) { @ :ip = word(1 $getitem(users $cnt)) @ :matches = getmatches(users % $ip) if (#matches > CLONES.MAX) { ^local reverse_matches fe ($matches) item { @ reverse_matches = item ## [ ] ## reverse_matches } fe ($reverse_matches) item { @ setitem(clones $numitems(clones) $getitem(users $item)) @ delitem(users $item) } } } if (numitems(clones)) { xecho -b Nickname IP for (@ :cnt = [0], cnt < numitems(clones), @ cnt++) { @ :user = getitem(clones $cnt) echo $[32]word(0 $user) $word(1 $user) } xecho -b Found $numitems(clones) clone${numitems(clones) > 1 ? [s] : []}. }{ xecho -b No clones found. } @ cleanup.clonechk() } /* * The actual output from /gusers. Store each nick/IP in the users * array. */ ^on ^832 "*" { @ setitem(users $numitems(users) $*) } xecho -b Checking for clones > $max_clones on $server ^gusers $server -l -u } /* * /MKILL [reason] * Mass kill - works with nicks or IPs and does wildcard matching. */ alias mkill (victim, reason) { if (victim) { @ cleanup.mkill() @ mkill.victim = victim @ mkill.reason = reason xecho -b Finding matches for \"$victim\" ^on ^831 "*" { if (numitems(mkill)) { xecho -b Nickname IP for (@ :cnt = [0], cnt < numitems(mkill), @ cnt++) { echo $[32]word(0 $getitem(mkill $cnt)) $word(1 $getitem(mkill $cnt)) } xecho -b Found $numitems(mkill) match${numitems(mkill) > 1 ? [es] : []}. input "Kill these users now? (y/N) " { switch ($tolower($left(1 $0))) { (y) { for (@ :cnt = [0], cnt < numitems(mkill), @ cnt++) { raw 610 $word(0 $getitem(mkill $cnt)) \"$mkill.reason\" } } (*) {#} } @ cleanup.mkill() } }{ xecho -b No matches found. @ cleanup.mkill() } } ^on ^832 "*" { if (match($mkill.victim $0) || match($mkill.victim $1) && [$0] != N) { @ setitem(mkill $numitems(mkill) $*) } } ^gusers * $victim }{ xecho -b Usage: /mkill [reason] xecho -b - Mass kills all users matching xecho -b - Wildcards are accepted } } /* * /OPERVIEW * Toggles Oper-View ON/OFF. This creates a split window which will receive * server messages. */ 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] } } /* * /TEMPMUZZLE