An anti-advertising script. If the code locates "www" or "http" in a channel it will kick them. Then the next time it k+bans.
on *:connect: {
unset %first.*
}
on *@:join:#: {
; Start Insert
set %first. $+ $nick On
.timer 1 900 unset %first. $+ $nick On
; End Insert
}
on *@:text:*:#: {
; Start Insert
if ($nick !isop #) {
if ( [ %first. [ $+ [ $nick ] ] ] != $null) {
if (www isin $strip($1-)) || (http isin $strip($1-)) {
ban # $nick 2
kick # $nick No Advertising Allowed!
}
if (join $chr(35) isin $strip($1-)) {
ban # $nick 2
kick # $nick No Advertising Allowed!
}
if ($0 == 1) && ($left($1,1) == $chr(35)) {
ban # $nick 2
kick # $nick No Advertising Allowed!
}
}
unset %first. $+ $nick
}
; End Insert
}
You can reduce a couple lines by using /ban -k, combination of the /ban & /kick command.
/help /ban
Also why not just strip everyting at the beginning of the event by inserting the code below before the first if statement:
tokenize 32 $strip($1-)
So you don\'t have to keep using strip everytime.
/help /tokenize
in fact foamy i dont c the importance of all of that code..i think u should have dont it like that
on :text::# {
if ($nick !isop $chan) {
if (www isin $1-) || (http isin $1-) || (join $chr(35) isin $1-) {
kick # $nick Spamming Not allowed.
}
}
}
i think that will fill the purpose .. much shorter anyway gj