on *:open:?:*:{
var %i = 1
while %i <= $numtok(%spam,59) {
[color:green];goes through all the items in %spam to see if it is mentioned in the message[/color]
if ($gettok(%spam,%i,59) isin $strip($1-)) { .close -m $nick | echo -a 4Lame spammer found.. | halt }
inc %i
}
}
menu status,menubar,nicklist,query {
Spam
.Add Spam Words:{
var %NewSpamWord $$?="Add a word to be considered as spam here (do not use ;)"
[color:green];Enter Spam word/sentence[/color]
if ($istok(%spam,%newspamword,59) == $true) { echo -a Already have >>06,00 %newspamword << in the spam list. | halt }
[color:green];if you already have it in the list, tell you and stop (don't add)[/color]
set %spam $addtok(%spam,%newspamword,59)
[color:green];Add the word to the list, separated by semicolon (;)[/color]
echo -a Added >>06,00 %NewSpamWord << to Spam List
[color:green];tell you it has been added[/color]
}
.Remove Spam Words:{
/remspam List
[color:green];run the alias /remspam to list items in %spam[/color]
}
}
alias remspam {
[color:green];if you type: /remspam List :lists items[/color]
if ($1 == List) {
var %i = 1
echo -a SPAM LIST
[color:green];lists them one by one[/color]
while %i <= $numtok(%spam,59) { echo -a %i - $gettok(%spam,%i,59) | inc %i }
echo -a END OF SPAM LIST
echo -a Remove an item, type: /remspam <number>
echo -a Display this list, type: /remspam List
$iif($$?="Enter number to remove" !== $null,set %SpamRemove $!,halt)
[color:green];you don't have to have the line above. It allows you to enter a number into a popup.[/color]
[color:green];you can replace it with halt and you will have to type /remspam <number> to remove item[/color]
}
if (%SpamRemove !== $null) { tokenize 32 $! }
[color:green];if you entered something into the popup, the line above tokenises the $1,$2,$3 to be what you typed (should be a number)[/color]
if ($2 !== $null) { echo -a Incorrect procedure. /remspam <number> or /remspam List | halt }
[color:green];Checks to see if you entered only ONE number[/color]
if ($1 !== $null) {
if ($1 !isnum 1- $+ $numtok(%spam,59)) { echo -a invalid number. /remspam List | halt }
[color:green];if the number entered is not in the range <1> to <number of items>, tells you[/color]
echo -a Deleted item $1 ( $+ $gettok(%spam,$1,59) $+ )
[color:green];Tells you it has been deleted[/color]
set %spam $deltok(%spam,$1,59)
[color:green];Deletes it[/color]
}
}