multi channel spam protection for a bot
!sp on/off/status
available to channel operators and helpers
catches
http - www - com - org - net
on *:TEXT:*:#: {
if ($nick isop $chan) || ($nick ishop $chan) {
if (!sp == $strip($1)) {
if (!$2) { .msg $chan ?spam command: ?spam on/off/status }
if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan Spam Protect is now $($+(%,sp,$chan),2) $+ . }
if ($strip($2) == status) { .msg $chan Spam Protect is currently $($+(%,sp,$chan),2) }
} }
if ($regex($strip($1-),/\b(?:http|www|com|org|net)\b/i)) && ($($+(%,sp,$chan),2) == on) {
if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 }
else { inc $+(%,spam,$nick) 1 }
if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -k $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from $chan for Spam/Advertising. }
.msg $chan $nick - Spamming is not allowed in this channel.
} }
it does work on the ustream flash chat, in a client it shows up as -opsusername/#channel- REMOVE usernameofposter messageofposter, but on the ustream flash chat, it shows up as [Removed By OpsUsername], but it wouldn't work on a network such as geekshed, but i just want this for ustream so can you help me? thank you in advance, sorry I just don't know how to write code, thank you
hi, this is awesome!, but I would like it if it did nothing but remove the url and kick on the second time unless your an op or half-op, then it doesn't remove the url or kick or warn, I would like for this to work on the ustream irc network and i think the script for removing posts on ustream is
notice # REMOVE $nick $1-
thank you so much if you know how to do it!
this is the script with the removing code in it and it works, but i dont want it to ban users, I just want it to kick them on the second time they post a link and i dont want it to do anything if your an op or half op
on *:TEXT:*:#: {
if ($nick isop $chan) || ($nick ishop $chan) {
if (!sp == $strip($1)) {
if (!$2) { eis | .msg $chan ?spam command: ?spam on/off/status }
if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan Spam Protect is now $($+(%,sp,$chan),2) $+ . }
if ($strip($2) == status) { .msg $chan Spam Protect is currently $($+(%,sp,$chan),2) }
} }
if ($regex($strip($1-),/\b(?:http|www|com|org|net)\b/i)) && ($($+(%,sp,$chan),2) == on) {
if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 }
else { inc $+(%,spam,$nick) 1 }
if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -k $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from $chan for Spam/Advertising. }
.msg $chan $nick - Spamming is not allowed in this channel.
notice # REMOVE $nick $1-
} }
thanks in advance
on $*:text:/^!sp\so(n|ff)$/iS:#: {
if (!%f) { inc -u5 %f | if ($nick(#,$nick,oh)) {
var %s *** Spam protection is now
$+($replace($regml(1),n,.en,ff,.dis),able) #spam
.msg # $iif($group(#spam) != on,%s off!,%s on!) } }
}
#spam on
on @*:text:*:#:url $1-
on @*:action:*:#:url $1-
on @*:notice:*:#:url $1-
alias -l url {
var %s = /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)/iS
if (($regex($1-,%s)) && ($nick(#,$nick,rv))) {
ban -ku300 # $nick 2 Spamming is not allowed in this channel!
}
}
#spam end
this should work if you dont want it kicking ops, halfops or voiced users
on *:TEXT:*:#: {
if ($nick isop $chan) || ($nick ishop $chan) {
if (!sp == $strip($1)) {
if (!$2) { eis | .msg $chan ?spam command: ?spam on/off/status }
if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan Spam Protect is now $($+(%,sp,$chan),2) $+ . }
if ($strip($2) == status) { .msg $chan Spam Protect is currently $($+(%,sp,$chan),2) }
} }
if ($regex($strip($1-),/http|www|com|org|net/i)) && ($($+(%,sp,$chan),2) == on) {
if ($nick isop $chan) || ($nick ishop $chan) || ($nick isvoice $chan) { halt }
else {
if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 }
else { inc $+(%,spam,$nick) 1 }
if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -k $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from $chan for Spam/Advertising. }
.msg $chan $nick - Spamming is not allowed in this channel.
}
} }