This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Simple MSL script conversion / twitch channel bad word scrip

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
B
Busi
Voice
Posts: 3
Joined: Fri Mar 27, 2015 9:22 pm
Location: Danmark

Simple MSL script conversion / twitch channel bad word scrip

Post by Busi »

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: 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
  }
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
B
Busi
Voice
Posts: 3
Joined: Fri Mar 27, 2015 9:22 pm
Location: Danmark

Post by Busi »

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.
Post Reply