| View previous topic :: View next topic |
| Author |
Message |
Busi Voice
Joined: 27 Mar 2015 Posts: 3 Location: Danmark
|
Posted: Fri Mar 27, 2015 9:28 pm Post subject: Simple MSL script conversion / twitch channel bad word scrip |
|
|
I have this MSL script i had made for me to be used with a twitch channel to timeout people that would post one of the banned words
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: | ; 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
}
} |
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Mar 28, 2015 2:27 am Post subject: |
|
|
In what format are the words added in badwords.ini ? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Busi Voice
Joined: 27 Mar 2015 Posts: 3 Location: Danmark
|
Posted: Sat Mar 28, 2015 4:08 pm Post subject: |
|
|
| caesar wrote: | | In what format are the words added in badwords.ini ? |
Not quite sure, we just add them with !filter add word
like !filter add camgirl
and the output in the file is
[badwords]
camgirl=1
for us it don't really matter how it stores or save the words as long as we can have a way to add it via commands and it can scan all chat for the words in the file. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|