1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
|
/*
* Some stuff for Moderators+
*
* Author: Brian Weiss <brian@got.net> - 2000, 2001
*/
assign AUTO_MUZZLE 1
assign AUTO_MUZZLE_TIME 60
assign OPERVIEW_SIZE 5
/* 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]}
}
alias c (level, void)
{
switch ($level)
{
(0) {admin setchanlevel $C leech}
(1) {admin setchanlevel $C user}
(2) {admin setchanlevel $C moderator}
(3) {admin setchanlevel $C admin}
(4) {admin setchanlevel $C elite}
(*)
{
xecho -b Usage: /c <level>
xecho -b - Sets channel level to <level>
xecho -b - <level> can be any numbered between 0 and 4
xecho -b - leech(0)/user(1)/moderator(2)/admin(3)/elite(4)
}
}
}
/* Clone checker. Executes /gusers and stores the output in an array.
It then checks each IP for duplicates and stores them in a new array. */
alias clones (server default "*", max_clones default "2", void)
{
@ cleanup_clonechk()
xecho -b Checking for clones > $max_clones on $server
^on ^831 "*"
{
for (@ :cnt = [0], numitems(users) > cnt, @ cnt++)
{
if (matchitem(clones $getitem(users $cnt)) < 0)
{
@ :blah = getmatches(users % $word(1 $getitem(users $cnt)))
if (#blah > max_clones)
{
fe ($blah) clone
{
@ setitem(clones $numitems(clones) $getitem(users $clone))
}
}
}
}
if (numitems(clones))
{
xecho -b Nickname IP
for (@ :cnt = [0], numitems(clones) > cnt, @ 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()
}
^on ^832 "*"
{
@ setitem(users $numitems(users) $*)
}
^gusers $server
}
/* 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], numitems(mkill) > cnt, @ 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], numitems(mkill) > cnt, @ 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 <string> [reason]
xecho -b - Mass kills all users matching <string>
xecho -b - Wildcards are accepted
}
}
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 tmuzzle (time, nick, reason)
{
if (time && nick)
{
raw 622 $nick \"${reason ? reason : [Temporary muzzle for $time seconds]}\"
timer $time raw 623 $nick
}{
xecho -b Usage: /tmuzzle <seconds> <nick> [reason]
xecho -b - Muzzles <nick> for <seconds>
}
}
alias u (nick, level default "1", void)
{
if (nick)
{
switch ($level)
{
(0) {raw 606 $nick leech}
(1) {raw 606 $nick user}
(2) {raw 606 $nick moderator}
(3) {raw 606 $nick admin}
(4) {raw 606 $nick elite}
(*) {xecho -b [level] must be a number between 0 and 4}
}
}{
xecho -b Usage: /u <nick> [level]
xecho -b - Sets <nick>'s userlevel to [level]
xecho -b - [level] is a number between 0 and 4
xecho -b - leech(0)/user(1)/moderator(2)/admin(3)/elite(4)
xecho -b - If no level is specified, the default of 1 will be used
}
}
alias cleanup_mkill (void)
{
^on 831 -
^on 832 -
@ delarray(mkill)
@ mkill.victim = mkill.reason = []
return
}
alias cleanup_clonechk (void)
{
^on 831 -
^on 832 -
@ delarray(users)
@ delarray(clones)
return
}
on #^flood 421 "% PUBLIC *" if (AUTO_MUZZLE)
{
^assign chan $2
^assign nick $0
^assign type $1
if (chan && nick && type)
{
if (finditem(pubflood $nick) < [0])
{
@ setitem(pubflood $numitems(pubflood) $nick)
whois -cmd
{
switch ($tr(/"//$1))
{
(Elite) {#}
(Admin) {#}
(Moderator) {#}
(*)
{
xecho -b PUBLIC flooding detected from $nick on $chan - Muzzling for $AUTO_MUZZLE_TIME seconds
raw 622 $nick \"Auto-muzzle for $AUTO_MUZZLE_TIME seconds: flood\"
timer $AUTO_MUZZLE_TIME eval raw 623 $nick;@ delitem(pubflood $finditem(pubflood $nick))
}
}
} $nick
}
}
wait -cmd @ chan = nick = type = []
}
/* bmw '01 */
|