Badword snippet

By juhapuha on May 10, 2008

This is a badword script.
Add, delete or list the badwords by rightclicking.

##########################
#  Badword by shitbreak  #
##########################
on *:load:{ 
  echo 2 -a * You have loaded a badword script made by shitbreak.
  echo 2 -a * This script will ban users using the forbidden language.
  echo 2 -a * You will see the menu by rightclicking.
  if (!$hget(badword)) { hmake badword }
  if ($exists(badword.hsh)) { hload badword badword.hsh }
}
on *:start:{
  if (!$hget(badword)) { hmake badword }
  if ($exists(badword.hsh)) { hload badword badword.hsh }
}
on *:disconnect:{
  if ($hget(badword)) { hsave badword badword.hsh }
}
menu * {
  ....Badword by shitbreak
  ..Add a badword:{
    var %bw = $$?"Enter the badword here."
    if ($hget(badword,%bw)) { echo 2 -a * The badword %bw already exists. }
    if (!$hget(badword,%bw)) { hadd badword %bw $date $time | echo 2 -a * The badword %bw added succesfully. }
  }
  ..Delete a badword:{
    var %bw = $$?"Enter the badword here."
    if (!$hget(badword,%bw)) { echo 2 -a * The badword %bw does not exist. }
    if ($hget(badword,%bw)) { hdel badword %bw | echo 2 -a * Badword %bw removed succesfully. }
  }
  ..List badwords:{
    if ($hfind(badword,*,0,w) == 0) { echo 2 -a * The badword list is empty. }
    if ($hfind(badword,*,0,w) > 0) {
      var %i = 1
      while (%i <= $hfind(badword,*,0,w)) {
        echo -a Badword: $hfind(badword,*,%i,w) Added on: $hget(badword,$hfind(badword,*,%i,w)) 
        inc %i
      }
    }
  }
}
on *:text:*:#:{
  if ($me isop $chan) {
    if ($hfind(badword,*,0,w) > 0) {
      var %i = $hfind(badword,*,0,w)
      while (%i) {
        if ($hfind(badword,*,%i,w) isin $1-) { ban -k1800 $chan $nick 1 Banned: Badword $+($mid($hfind(badword,*,%i,w),1,1),$str($chr(42),$calc($len($hfind(badword,*,%i,w)) - 1))) - Banned for 30minutes. }
        dec %i
      }
    }
  }
}

Comments

Sign in to comment.
Cheiron   -  Aug 11, 2008

no worries

 Respond  
SebMcCayen   -  Aug 11, 2008

Ah okey, thank you very much! :)

Edit
Weird, it still doesn´t remove the ban :/

 Respond  
Cheiron   -  Aug 11, 2008

the code still has not been updated looking at it Seb.. it still reads ban -k600

it should be ban -ku600

as xDaeMoN pointed out. so change it to that and it will work :)

 Respond  
SebMcCayen   -  Aug 11, 2008

What is the problem if my bot don´t remove the ban after 30 minutes?
Thanks for the snippet anyway :)

 Respond  
foobar   -  May 12, 2008

lol lazy git
not even Im that N00b

To be honest, I\'d rather use a program.
A) I don\'t think a user wants to go through the labor of constantly adjusting the dialog and making it align perfectly.
B) With programs such as dialog studio, you have alignment tools, etc.; making the final outcome even better than constantly adjusting everything.

Dialogs, in most cases, are used to look better and make things easier to handle. Why go through just as much work creating them? Sure, you might be lazy, but the result is worth it.

 Respond  
xDaeMoN   -  May 11, 2008
ban -k1800 ...

should also be

ban -ku1800 ...
  • Dont forget the \"u\" switch
 Respond  
guest598594   -  May 11, 2008
juhapuha   -  May 11, 2008

;>

 Respond  
napa182   -  May 11, 2008

juhapuha said:

Am I noob if i don\'t want to WRITE dialogs? :)

no just lazy =P

 Respond  
Jethro   -  May 11, 2008

This is a nice bad word script using hash tables. But upon using it, I\'ve found that it doesn\'t show the bad words stored. (I don\'t know maybe it\'s just me) Instead it shows the date and time only. I did change something a little to and it turns out well and it fits my needs:

hadd -m Profanity %bw $date $asctime(hh:nn:ss TT) | echo -a 4* 2The bad word $+ 4 %bw 2is added successfully.
 .List Bad Words: {
    if (!$hget(badword,1).item) { echo -s 6* 2my badword list is currently empty. }
    else var %x = $hget(badword,0).data,%d = 0
    while (%x) {
      echo -s 4*1 $hget(badword,%x).data ->4 $hget(badword,%x).item 2is on my profanity list.
      dec %x | inc %d
    }
  }
}
 Respond  
juhapuha   -  May 11, 2008

I don\'t want to write dialogs by hands! I know they\'re not hard to make.
Am I noob if i don\'t want to WRITE dialogs? :)

 Respond  
Eugenio   -  May 11, 2008

lol lazy git
not even Im that N00b

 Respond  
napa182   -  May 11, 2008

why use a program for? =/ just make one by hand they are not hard to make.

 Respond  
juhapuha   -  May 11, 2008

I don\'t have any program to create dialogs, and I will never make them without program. :D

 Respond  
Pepsi_Man0077   -  May 11, 2008

Nice Snippet, would love to see this in a dialog

 Respond  
juhapuha   -  May 10, 2008

probably because i wasn\'t gonna use ban -k but for some reason i did anyway. :D
so i forgot to remove the kick :)

 Respond  
napa182   -  May 10, 2008

um why put

kick $chan $nick Banned:

if you have this before it

ban -k1800 $chan $nick 1

????

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.