mIRC Homepage
Posted By: confuzzed swear.words list - 13/01/05 08:38 AM
ok i figure sincet i got the help on getting the code to wortk and it does i should start a new topic for this i would like to know if i can make some sort of .ini/mrc file for all the swear words because i have a large list that it wont take now here is the code for the warn/ban bot
Code:
alias swear {
  return [censored] [censored]
}


on @*:TEXT:*:#: {  

  if ($nick !isop #) {    

    var %i = 0    

    while (%i < $numtok(%swear.words,32)) {      

      inc %i     

      var %current.word = $gettok(%swear.words,%i,32) {        

        if ($istok($strip($1-),%current.word,32) == $true) {

          set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)

          if (%rl. [ $+ [ $address($nick,2) ] ] == 1) { 

            notice $nick Please don't swear! - this is your first warning! 

          }

          if (%rl. [ $+ [ $address($nick,2) ] ] == 2) { 

            notice $nick Please don't swear! - this is your second warning next time you will be banned! 

          }        

          if (%rl. [ $+ [ $address($nick,2) ] ] >= 3)  {           
            ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--   

          }  

        }  

      }  

    }  

  }  

}

all help is apreciated
Posted By: Sigh Re: swear.words list - 13/01/05 09:02 AM
If you think a text file would be easiest for you to handle the list of words in then you can use the following text event:

Code:
on @*:text:*:#:{
  if ($nick !isop #) {
    if ($read([color:brown]file.txt[/color],rn,/^(\Q $+ $replacecs($1-,\E,\E\\E\Q,$chr(32),\E|\Q) $+ \E)$/iS)) {
      var %s = $+(%,$cid,$site,#)
      inc -u3600 $(%s)
      if ($(%s,2) < 3) .notice $nick Please don't swear! - $iif($v1 = 1,this is your first warning!,this is your second warning next time you will be banned!)
      else ban -k # $nick 2 Banned for 1day
    }
  }
}


Change file.txt to the name/path of the file containing the swears, each swear on a new line
Posted By: confuzzed Re: swear.words list - 13/01/05 09:13 AM
theres no way for me to keep the code i have now and intergrate the .txt file in?
Posted By: confuzzed Re: swear.words list - 14/01/05 03:09 AM
no one can help me : ' (
Posted By: confuzzed Re: swear.words list - 14/01/05 05:40 AM
ok well i dont mean to triple post but i wanted to say i tried the code posted above but it did nothing and i mad a file.txt for it so i wouldnt have to goto the trouble of changeing that part of the code but it didnt do anything after swearing. and yes i added swear words to the file.txt file
Posted By: SladeKraven Re: swear.words list - 14/01/05 05:56 AM
I'm not sure whether this would work, like FiberOPtics I'm going to blame this on too many late nights. wink

Put all the profanities on one line of the file swear.txt.

Code:
on @*:TEXT:*:#: {     
  if ($nick !isop #) {   
    var %i = 0       
    while (%i < $numtok($read(swear.txt,1),32)) {      
      inc %i              
      var %current.word = $gettok($read(swear.txt,1),%i,32) {                
        if ($istok($strip($1-),%current.word,32) == $true) {        
          set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)   
          if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {             
            notice $nick Please don't! - this is your first warning!    
          }          
          if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {                
            notice $nick Please don't! - this is your second warning next time you will be banned!     
          }      
          if (%rl. [ $+ [ $address($nick,2) ] ] >= 3)  {           
            ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--    
          }          
        }        
      }     
    }    
  }
}
Posted By: confuzzed Re: swear.words list - 14/01/05 06:23 AM
YAY it worked *does happy dance* i realy appreciate it slade comes to save thew day agiain YAY works great man i still couldnt use my whole list but i got a good amount up there and alot more then i could befor and im happy YAY *bows befor o great mighty slade* YAY
Posted By: SladeKraven Re: swear.words list - 14/01/05 06:25 AM
You're welcome man lol.. grin
Posted By: Hendrik_ Re: swear.words list - 01/02/05 12:17 PM
I'm having kinda the same problem, but I want to kick a person also when he has more than 1 bad word in a sentense.
example: when someone says: "Hello lame f*ckers", I want to kick the person, but only because he sayd "lame f*ckers", not only 'f*ckers' itself.
I hope someone can help me smile

Best Regards,
Hendrik

Edit:
Quote:

on @*:TEXT:*:#l: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok($read(words.txt,ii1),124)) {
inc %i
var %current.word = $gettok($read(words.txt,1),%i,124) {
//echo -a %current.word
if ($istok($strip($1-),%current.word,124) == $true) {
/msg $chan fout!
//echo -a %current.word
var %cal2 = $readini(stats.ini, mainstats, %current.word)
var %cal = $calc(%cal2 + 1)
/writeini stats.ini mainstats %current.word %cal
goto end
}
}
}
}
:end
}
}


This is how i c/p your script you gave 2 posts up here (ty for that btw smile), what do i have to edit to make it work like i want it to?
Posted By: xolademoness Re: swear.words list - 23/02/05 06:00 PM
I agree with the last post


..people who make scripts that ban people just for using swear words no matter the context just need to get a life.
Posted By: SladeKraven Re: swear.words list - 23/02/05 06:17 PM
What do you mean?
Posted By: di_mis Re: swear.words list - 23/03/05 12:36 PM
How can i make this code to work with wildcards
example : *shi* *f*ck* ..etc
on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok($read(swear.txt,1),32)) {
inc %i
var %current.word = $gettok($read(swear.txt,1),%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--
}
}
}
}
}
}
Posted By: T1Cybernetic Re: swear.words list - 10/04/05 07:54 AM
Quote:
I'm not sure whether this would work, like FiberOPtics I'm going to blame this on too many late nights. wink

Put all the profanities on one line of the file swear.txt.

Code:
on @*:TEXT:*:#: {     
  if ($nick !isop #) {   
    var %i = 0       
    while (%i &lt; $numtok($read(swear.txt,1),32)) {      
      inc %i              
      var %current.word = $gettok($read(swear.txt,1),%i,32) {                
        if ($istok($strip($1-),%current.word,32) == $true) {        
          set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)   
          if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {             
            notice $nick Please don't! - this is your first warning!    
          }          
          if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {                
            notice $nick Please don't! - this is your second warning next time you will be banned!     
          }      
          if (%rl. [ $+ [ $address($nick,2) ] ] &gt;= 3)  {           
            ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --&gt; $ifmatch &lt;--    
          }          
        }        
      }     
    }    
  }
}


My first post and my first search found exactly what i was looking for, smile.

Thanks for the great info!
Posted By: SladeKraven Re: swear.words list - 10/04/05 02:40 PM
You're welcome. smile lol.
Posted By: Hammer Re: swear.words list - 11/04/05 03:11 AM
on $*:TEXT:/(lame|duck|shoot|dang|drats)/iS:#: if ($regml(0) > 1) ban -ku60 # $nick 2 U Sware 2 much!

wink
Posted By: SonnyZA Re: swear.words list - 05/12/05 12:35 PM
i've searched and got this very fast. thnx smile

Is there a way the i can use a type of *swearword* style of looking up? What i mean, lets say this is the swearword ---> dung

now, without putting all the varaints of dung, like dungface, dunger etc. how can I pick up that swear word?

Hope I explained it properly laugh
Posted By: scoot Re: swear.words list - 28/07/17 07:35 PM
one little problem line 4
* /while: '<' unknown operator (line 4, swear.mrc)
not sure why it only posts as < but its '& l t ;'
Posted By: maroon Re: swear.words list - 29/07/17 12:28 AM
the line should be in your script with the 1-character less-than symbol (alt-40) and not the 4-character html code beginning with the ampersand. I do not see an error in the code.
Posted By: scoot Re: swear.words list - 29/07/17 03:24 AM
Ill take a look Thanks for the reply :)))
© mIRC Discussion Forums