Badword System
Posted by HellRaz0r
Friday, September 08, 2006
Description: To make adding/removing/detecting Badwords easy :)

#--------------------------------------------------------------------------------#
#    Badword System - Coded by HellRaz0r                                        #
#    irc://irc.gamesurge.net/script                                                     #
#                                                                                                    #
#    Commands/Identifiers                                                                #
#    --------------------                                                                       #
#    /addbword <Word> - Add a word to your badword list.                  #
#    /rembword <Word> - Remove a word from your badword list.       #
#    /bwordlist - Display your badword list.                                          #
#    $bword(<Some Text>) - Check if the Text contains any badwords. #
#--------------------------------------------------------------------------------#

alias addbword {
  if (!$1) listbword
  elseif $read(badwords.txt,w,$1-) && $v1 == $1- { write $+(-dl,$readn) badwords.txt }
  write badwords.txt $1- | if ($show) echo -a [^K]2* Added $qt($1-) to the Badword list
}
alias rembword {
  if $read(badwords.txt,w,$1-) && $v1 == $1- {
    write $+(-dl,$readn) badwords.txt | if ($show) echo -a [^K]2* Removed $qt($1-) from the Badword list
  }
  elseif ($show) echo -s [^K]2* Could'nt find $qt($1-) in the bwordlist
}
alias bword {
  var %x 1
  while $read(badwords.txt,n,%x) { if ($v1 isin $1-) return $true | inc %x }
  return $false
}
alias bwordlist {
  var %x 1
  while $read(badwords.txt,n,%x) {
    if ($v1) {
      var %z $v1 | if !%y { echo -a [^K]2- | echo -a [^K]2* Badword List: }
      echo -a [^K]2* %z | var %y 1
    }
    inc %x
  }
  if (!%y) echo -a [^K]2* No badwords set | else echo -a [^K]2-
}
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world