This is a script that kicks this annoying kid nicked 'Sparky' for saying 0. He harasses and annoys networks for saying it, and gets himself glined and +b'd for it. No one thinks its funny, so we decided to start a program called "N0" (N, Zero), to discourage this obnoxious behavior. It started more of a joke. The script itself may seem useless, but improvement is appreciated :D
N0: Ops get 1 point for kicking Sparky each time he says '0'. After 16 points, ops are moved up on the access list.
Change Log
July 24, 2010: Checks if $me is opped on the channel.
Adds Regular Expression in searching for '0'.
July 25, 2010: Corrected Regex matching '0' (removed unnecessary tags 'g' and 'i'. Simplified checking if user is opped. Thank you @Jethro_
July 26, 2010: Added regex matching variations of "Sparky" to kick. Thank you @Jethro_
on @$*:text:/^0$/S:#:{
if ($regex($nick,/^([-]?sp(a|\[a\])rky(-?|_?|0?|\[iPod\]?)$)/i)) {
if (%score == 16) {
.onotice # I've kicked Sparky $v1 times for saying '0'
unset %score
}
else {
inc %score
kick # $nick +1 for $me $+ ! My score: %score
}
}
}
miniCruzer, you don't need the /i, /g modifier (there is no uppercase or lowercase for a number anyway...the /g modifier is to match a string multiple times. The way you have it only requires one...and you have the regex matched mainly for the number zero as is, hence the caret and dollar sign used), and the $me isop # can be substituted by a @ prefix:
on @$*:text:/^0$/S:#:{
if ($nick == sparky) {
if (%score == 16) {
.onotice # I've kicked Sparky $v1 times for saying '0'
unset %score
}
else {
inc %score
kick # $nick +1 for $me $+ ! My score: %score
}
}
}