Simple badword script

By Lindrian on Jul 15, 2007

This is a simple badword script. I aint using a fancy dialog, as this was mainly meant for a little experienced users along with a bot, remotly.

Anyhow, there's a menu if you wish to use it local.
Type !badword [on|off] to turn it on/off.

It will warn the user 1 times, kick on second and ban on third.

Please read through the script and read commented information, change the badwords and channels below the commented text.

Just paste in remotes (alt + r) and youre ready to do...

PS: The code might not be the best nor prettiest, i made it cause i was bored, and were going to show a friend how to do it :p.

Enjoy!

on *:text:*:#: {
  if ($1 == !badword) && ($_chan($chan)) && ($istok(on off,$2,32)) && ($nick isop $chan) {
    set %_badword $iif($2 == off,$v2,on)
    msg $chan Badword protection is now %_badword
  }
  else {
    if (%_badword == on) && ($me isop $chan) && ($nick !isop $chan) && ($_chan($chan)) {
      ;  Change the badwords below to fit your own needs.
      var %badword = shit,gay,homo,pussy, %a = $numtok(%badword,44)
      while (%a) {
        var %bchk = $gettok(%badword,%a,44)
        if (%bchk isin $1-) {
          inc $+(%,badword,.,$nick,.,$chan)
          var %times = $($+(%,badword,.,$nick,.,$chan),2)
          if (%times == 1) {
            .notice $nick Please dont use badwords in $chan $nick $+ . You've broken the rules %times time. (You said badword: %bchk $+ )
          }
          elseif (%times == 2) {
            kick $chan $nick Please dont use badwords in $chan $nick $+ . You've broken the rules %times times. Next time you'll be banned! (You said badword: %bchk $+ )
          }
          elseif (%times > 2) {
            ban -ku900 $chan $nick 2 I warned you 2 times already. Bye bye. 15 minutes ban.
            unset $+(%,badword,.,$nick,.,$chan)
          }
        }
        dec %a
      }
    }
  }
}

alias -l _chan {
  ;  Change the channels for the bot to work on below, to make it work in all channels just input "#".
  var %a = #, %b = $numtok(%a,44)
  while (%b) {
    if ($1 == $gettok(%a,%b,44)) || (%a == $chr(35)) {
      return $true
    }
    dec %b
  }
}

on *:exit: {
  unset %badword.*
}

menu channel {
  .Turn badword filter $iif(%_badword == on,off,on) : set %_badword $iif(%_badword == on,off,on)
}

Comments

Sign in to comment.
Charlatan   -  Jul 14, 2015

Example from old Mirc Script, modify whatever you want because some words are for spanish language:

on @!*:text:*:#:if (%Badword. [ $+ [ # ] ] = si) { Badwordkick $strip($1-) }
on @!*:action:*:#:if (%Badword. [ $+ [ # ] ] = si) { Badwordkick $strip($1-) }
alias -l Badwordkick { 
  var %b = $strip($1-)
  if ($nick(#, $nick, '.@)) halt
  if ($regex(%b,/(b!tchs?|chtm|choch[ao]s?|ogetes?))/i) badkick
  elseif ($regex(%b,/(fuks?|fucks?|put[ao]s?|cabron.?s?))/i) badkick
  elseif ($regex(%b,/(me las pelas?|pendej[ao]s?))/i) badkick
  elseif ($regex(%b,/(mamadas?|lammers?|suckers?))/i) badkick 
  elseif ($regex(%b,/(pito|vergas?|culos?))/i) badkick
  elseif ($regex(%b,/(chinga|suks?|culer[ao]s?|ogt))/i) badkick
  elseif ($regex(%b,/(dicks?|bitchs?|whores?|sluts?))/i) badkick
  elseif ($regex(%b,/(ass holes?|assholes?|pingas?))/i) badkick
  elseif ($regex(%b,/(soy (Dios|.. Dios)))/i) bigkick
  elseif ($regex(%b,/(I'?a?m (God|..?.? God)))/i) bigkick
  halt   
}
Menu Channel {
-
Protection
.$Iif(%Badword. [ $+ [ # ] ] == si, $Style(1)) Badword Protection: {
    Set %Badword. [ $+ [ # ] ] $Iif(%Badword. [ $+ [ # ] ] == si, no, si)
    Echo -at * 0Badwords Protection $Iif(%Badword. [ $+ [ # ] ] == si, Activated, Desactivated)
  }
}
-

Badkick and Bigkick are aliases post whatever you want there.

 Respond  
jaystew   -  Sep 06, 2009

ive searched this site for a good swear warnkick ban script for some time, i think this is one of the best ones and works great for me :D yes i know it was posted in 2007 :P

 Respond  
fergie   -  Sep 18, 2007

in the script i mean lol, i\'m not THAT mIRC challenged ;P

 Respond  
simplicity   -  Sep 15, 2007

Remotes. ;)

 Respond  
fergie   -  Sep 15, 2007

thank yas, and umm, where would i be putting this? :)

 Respond  
simplicity   -  Sep 14, 2007

$istok($1-,$gettok(%badword,%a,44),32) should solve that problem.

 Respond  
fergie   -  Sep 14, 2007

if someone were to say \"shitzu\" it would trigger it still... me and my mIRC challenged self have no clue how to fix that, so i\'m asking you :P

 Respond  
xDaeMoN   -  Jul 17, 2007

@ Lindrian, yes.

 Respond  
Lindrian   -  Jul 17, 2007

I know about $istok(), but would $istok() be able to handle the same functions as the $_chan() would?
I mean, with the # or #chan1,#chan2 etc. As \"#\" stands for all channels.

No score yet tho.

 Respond  
Pass   -  Jul 17, 2007

For your \"$_chan\" alias, Lindrian, you might find the \"$istok\" identifier to be more useful, as you do not even need to send parameters through a loop.

 Respond  
Lindrian   -  Jul 15, 2007

If you want to contribute with a regex match, to improve the code, ill add it kerstt, and give you full credit for it.

 Respond  
Lindrian   -  Jul 15, 2007

Im not using regex cause I dont know how regex workks, not good atleast.

And your example Roy would make 0 difference, isin/iswm does the same, no difference.

 Respond  
Roy911   -  Jul 15, 2007

Like kerstt has said, using regex would catch the badwords easier.

Ex: Rather than \"if (%bchk isin $1-) { }\" use \"if ($regex($1-,%bchk) == 1) { }\".

This would catch the same thing, but in some cases may work better.

 Respond  
kerstt   -  Jul 15, 2007

why dont you use regex to match the badwords?

 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.