This is a supreme spamfilter dialog, very easy to use.
You need to be an ircop and have access to add spamfilters.
Thanks to RusselB and Jethro_ for all there help in the forums. thanks guys :D
To use simple copy the code below and add it to a new page in remotes(alt+r) the right click a chan and u sill see the "spamfilter" in there.
Very easy to use.
For unrealircd, not sure if the commands are the same on others
Have fun
Gemster
P.S - Not all servers support viruschan but some do.
Menu channel {
spamfilter:/dialog -m spam spam
}
dialog spam {
title "Spamfilter"
size -1 -1 168 256
option dbu
edit "- Word for spamfilter to catch(regex) -", 1, 8 26 150 10, autohs
box "Type", 2, 7 43 73 108
check "c", 3, 16 70 50 10
check "p", 4, 16 80 50 10
check "n", 5, 16 90 56 10
check "N", 6, 16 100 57 10
check "P", 7, 16 110 57 10
check "q", 8, 16 120 57 10
check "a", 9, 16 130 56 10
check "t", 10, 16 140 50 10
text "Specifies the target type, You can add multple targets.", 11, 9 52 70 17, center
box "Action", 12, 87 43 73 108
radio "Block", 13, 96 70 50 10
radio "Kill", 14, 96 80 50 10
radio "Kline", 15, 96 90 50 10
radio "Gline", 16, 96 100 50 10
radio "Zline", 17, 96 110 50 10
radio "GZline", 18, 96 120 50 10
radio "Kline", 19, 96 130 50 10
radio "VirusChan", 20, 96 140 50 10
text "sSpecifies the action to be taken (only 1 action can be specified)", 21, 89 50 69 20, center
box "Tkltime", 22, 7 150 154 44
edit "-", 23, 68 176 36 10, center
text "The duration of the bans. This can be set to - for defaule value(for block use - ).", 24, 8 157 150 15, center
box "Reason", 25, 7 193 155 42
text "The reason for spamfilter. You CANNOT use spaces in this, but underscores ('_') will be translated into spaces at runtime.", 26, 8 200 151 18, center
edit "Add_Reason_For_Spamfilter_Here", 27, 16 219 138 11, autohs
button "Add", 28, 24 240 37 12
box "Regex", 29, 7 3 153 38
text "This is the actual regex or 'bad word' where we should block on and perform the action", 30, 8 10 150 15, center
button "List", 31, 64 240 37 12
button "Remove", 32, 104 240 37 12
}
on *:dialog:spam:sclick:3-10:{
$iif($did($did).state,set %stype $addtokcs(%stype,$did($did),32),set %stype $remtokcs(%stype,$did($did),1,32))
}
on *:dialog:spam:close:*:{
unset %stype %saction
}
on *:dialog:spam:sclick:13-20:{
$iif($did($did).state,set %saction $did($did))
}
on *:dialog:spam:sclick:28:{
spamfilter add $remove(%stype,$chr(32)) %saction $did(23) $did(27) $did(1)
}
on *:dialog:spam:sclick:31:{ spamfilter }
on *:dialog:spam:sclick:32:{ spamfilter del $remove(%stype,$chr(32)) %saction $did(23) $did(27) $did(1)
}
I can't really imagine that actually helping people who know the /spamfilter command as it is, but you could make it helpful by allowing straight text for the reason and then using something like:
$replace($did(27),_,_,$chr(32),)
It would also be more helpful if those checkboxes were words, rather than the actual character used in /spamfilter, e.g. 'Private Messages' instead of 'p'.
Good job with the script, though. :)
By the way, Unreal supports the 'warn' action now.
You could check the users modes to ensure that they have sufficient access.
menu * {
$iif((a isin $usermode) || (C isincs $v2) || (o isin $v2),Spamfilter) : dialog $iif(!$dialog(spam),-ev,-md) spam spam
}
This will 1) prevent someone with the code but without IRCops from even accessing the code.
2) Open the dialog if closed, or restore it if open but minimized