the script have 4 commands filter add, filter remove, filter enable and disable
all command should be accessed by channel ops only
and when one of the banned words is found it would do a text command in form of .timeout username 5
where username is the person who wrote the word
here is the MSL script
Code: Select all
; on text event
on *:TEXT:*:#:{
var %file = badwords.ini
if ($1 == !filter) {
if ($nick !isop $chan) return
; if someone types "!filter" without parameters, output its status
if (!$2) {
msg $chan Filter is currently $iif(%filter_enabled,en,dis) $+ abled.
return
}
if ($2 == add) {
if (!$3) { msg $chan you have to provide a word to add! | return }
writeini %file badwords $3 1
msg $chan word $qt($3) added to filter list.
return
}
if ($2 == remove) {
if (!$3) { msg $chan you have to provide a word to delete! | return }
if (!$readini(%file,badwords,$3)) {
msg $chan word $qt($3) not found in filter list!
return
}
remini %file badwords $3
msg $chan word $qt($3) removed from filter list.
return
}
if ($2 == enable) {
set %filter_enabled 1
msg $chan filter is enabled.
return
}
if ($2 == disable) {
set %filter_enabled 0
msg $chan filter is disabled.
return
}
}
if (!%filter_enabled) || ($nick isop $chan) return
var %a = 1, %b = $0
while (%a <= %b) {
if ($readini(%file,badwords,$gettok($1-,%a,32))) {
; word has been found
msg $chan $nick $+ , please do not talk / ask about that
msg $chan .timeout $nick 5
}
inc %a
}
}