mIRC Home    About    Download    Register    News    Help

Print Thread
#177511 26/05/07 05:45 AM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
I used the search button on this forum and I understood that I need to use regular expressions for the following code:

Code:
on @*:TEXT:*:#chanName:{
  IF ($nick isop #) { RETURN }
  VAR %s = $strip($1-)
  IF ((*BadWord1* iswm %s) || (*BadWord2* iswm %s) || (*BadWord3* iswm %s) || (*BadWord4* iswm %s)) {
    SET -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)


The problem is that the script does not read only the bad word in a sentence, but also other words that contain the bad word...

example: XYZbadWord1 - should not trigger the script

Also is it possible the read the bad words from a .txt ?

I would apreciate the help. Thanks.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: yetti
I used the search button on this forum and I understood that I need to use regular expressions for the following code:

Code:
on @*:TEXT:*:#chanName:{
  IF ($nick isop #) { RETURN }
  VAR %s = $strip($1-)
  IF ((*BadWord1* iswm %s) || (*BadWord2* iswm %s) || (*BadWord3* iswm %s) || (*BadWord4* iswm %s)) {
    SET -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)


The problem is that the script does not read only the bad word in a sentence, but also other words that contain the bad word...

example: XYZbadWord1 - should not trigger the script

Also is it possible the read the bad words from a .txt ?

I would apreciate the help. Thanks.


Code:
 
on *:TEXT:*:#chanName:{
  var %s = $strip($1-) , %clk = 1
  while (%clk <= $lines(badwords.txt)) {
    if ($wildtok(%s,$read(badwords.txt,n, $+ %clk $+ ),1,32) == $read(badwords.txt,n, $+ %clk $+ )) { echo -a OMG $nick Said a bad word!!!! }
    inc %clk
  }
}


Basically the echo command can be changed to whatever to perform the command this will simply check your text file for matching words in your txt file (I would suggest a hash file but im a little rusty) a $wildtok event matches specifications if not wildcarded example

$wildtok(My puppy is awesome,*up*,1,32) returns puppy
Noticed how up is wildcarded
$wildtok(My puppy is awesome,up,1,32) returns $False

$wildtok(My puppy is awesome,puppy,1,32) returns puppy

you can also set nth to 0 so it returns numbers over word

so in the script I did a simple while loop to check txt file for each word 1 by 1 in your $1- command to see if theres a bad word


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: May 2005
Posts: 54
M
Babel fish
Offline
Babel fish
M
Joined: May 2005
Posts: 54
Try this code.
Code:
on @*:text:*badword*:#: if ($nick !isop $chan) && ($nick !isvoice #) { mode # +b $address($nick,2) | kick # $nick REASON }


/server IRC.RomaniaIRC.ORG
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
An alternative suggestion
Code:
on *:TEXT:*:#chanName:{
  if $nick($chan,$nick,r) {
    var %s = $strip($1-),%clk = 1, %lines = $lines(badword.txt)
    while (%clk <= %lines) {
      if ($wildtok(%s,$read(badwords.txt,n, $+ %clk $+ ),1,32) == $read(badwords.txt,n, $+ %clk $+ )) { echo -a OMG $nick Said a bad word!!!! }
      inc -u3600 $+(%,badword,.,$nick)
      inc %clk
    }
  }
}


Joined: Apr 2018
Posts: 24
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Apr 2018
Posts: 24
How to make this badword.text to add badwords in list
like cockold tu put in badwordlist in this way cock* for text and action the same, and to recognise the badwords in channel cockold from cock* to take ban in IP/HOST

example: user write azzhole need to put add badwords in this way azz* or when hey wrute fffffff to add badwords ff* in badword.text with comand /addbadw azz* /delbadw azz*
they can try use word : azzhole, azz hole, azz-hole, azz`hole azz^hole, azz_hole, azz|hole, a[z]z[h]ole az{z}h{o}le, @zzh0l3, 4zzh0l3 so need some stuff to recognise the badword in channel and to add the badword in badword.text, anyone have any idea ?

Last edited by Tano; 12/04/18 08:39 PM.

Link Copied to Clipboard