egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple MSL script conversion / twitch channel bad word scrip

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Busi
Voice


Joined: 27 Mar 2015
Posts: 3
Location: Danmark

PostPosted: Fri Mar 27, 2015 9:28 pm    Post subject: Simple MSL script conversion / twitch channel bad word scrip Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Mar 28, 2015 2:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Busi
Voice


Joined: 27 Mar 2015
Posts: 3
Location: Danmark

PostPosted: Sat Mar 28, 2015 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber