mIRC Home    About    Download    Register    News    Help

Print Thread
#273296 14/03/25 05:36 PM
Joined: May 2022
Posts: 108
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 108
Code
alias checknicks {
  var %x = 1
  while (%x <= $lines($mircdirbnicks.txt)) {
    var %i = 1
    while (%i <= $nick($chan,%i)) {
      if ($read(bnicks.txt,%x) iswm $nick($chan,%i)) {
        kick $chan $nick($chan,%i) Bad Nick. < $+ $read(bnicks.txt,%x) $+ >
        ban $chan $nick($chan,%i)
      }
      inc %i
    }
    inc %x
  }
}

on !*:NICK:{ checknicks }

Can someone explain me (in basic words or I'll never learn) why doesn't it works?
Thanks

Joined: Nov 2021
Posts: 143
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 143
Code

ON  *!:nick: {
  var %newnick = 1 , %badwords = 1
  while ($comchan($newnick,%newnick) != $null )  {
    var %chan $v1
    if ($nick(%chan,$me,~&@%) || !$nick(%chan,$newnick,~&@%)) {
      while (%badwords <= $lines(badnicks.txt)) { 
        if ($regex($newnick,/( $+ $read(badnicks.txt,%badwords) $+ )/i)) {  
          mode %chan +b $+(*,$regml(1),*!*@*)
          kick %chan $newnick «--bad-nick--»  
        } 
        inc %badwords
      }
    }
    inc %newnick 
  }
}


Joined: May 2022
Posts: 108
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 108
Originally Posted by Simo
Code

ON  *!:nick: {
  var %newnick = 1 , %badwords = 1
  while ($comchan($newnick,%newnick) != $null )  {
    var %chan $v1
    if ($nick(%chan,$me,~&@%) || !$nick(%chan,$newnick,~&@%)) {
      while (%badwords <= $lines(badnicks.txt)) { 
        if ($regex($newnick,/( $+ $read(badnicks.txt,%badwords) $+ )/i)) {  
          mode %chan +b $+(*,$regml(1),*!*@*)
          kick %chan $newnick «--bad-nick--»  
        } 
        inc %badwords
      }
    }
    inc %newnick 
  }
}


Perfect. As always wink
Just a problem...
I created a file badnick.txt : of course I added forbidden nick and I used * as jolly.
Instead of to write HORSE, HORSING, etc... I added *HORS* (to include horse, horsing, fxxxinghorse...).
Or in italian cacc* , to include cacca, cacche, cacchio, cacchione...
Or again *GOD* to include any blasphemy before or after word GOD.
Of course list is in alphabetic order and a word each line.
It doesn't work. Why?
Thanks

Last edited by Fernet; 13/04/25 02:28 PM.
Joined: Nov 2021
Posts: 143
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 143
give this a try:

Code

ON  *!:nick: {
  var %newnick = 1 , %badwords = 1
  while ($comchan($newnick,%newnick) != $null )  {
    var %chan $v1
    if ($nick(%chan,$me,~&@%) || !$nick(%chan,$newnick,~&@%)) {
      while (%badwords <= $lines(badnicks.txt)) { 
          if ($read(badnicks.txt,%badwords) iswm $newnick) { 
          mode %chan +b $+(*,$regml(1),*!*@*)
          kick %chan $newnick «--bad-nick--»  
        } 
        inc %badwords
      }
    }
    inc %newnick 
  }
}


Joined: May 2022
Posts: 108
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 108
Originally Posted by Simo
give this a try:

Code

ON  *!:nick: {
  var %newnick = 1 , %badwords = 1
  while ($comchan($newnick,%newnick) != $null )  {
    var %chan $v1
    if ($nick(%chan,$me,~&@%) || !$nick(%chan,$newnick,~&@%)) {
      while (%badwords <= $lines(badnicks.txt)) { 
          if ($read(badnicks.txt,%badwords) iswm $newnick) { 
          mode %chan +b $+(*,$regml(1),*!*@*)
          kick %chan $newnick «--bad-nick--»  
        } 
        inc %badwords
      }
    }
    inc %newnick 
  }
}


There's not mentioned any #channel.
Why?
Thanks

Joined: Nov 2021
Posts: 143
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 143
im not sure i understand the question.

Joined: May 2022
Posts: 108
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 108
Originally Posted by Simo
im not sure i understand the question.

OK. Let me try to explain...
I created a list of badwords in a text file badwords.txt:

duck
lussy
pass
button
--->bone<---


etc....

If an user write LOOK AT MY BONE he'll be banned because te word BONE is in the list of words.
But if he write LOOK AT MY FATBONE he won't be banned because the word FATBONE is not in the list

So I used wildcard:

*duck*
*lussy*
?ass*
*butt*
--->*bone*<---


So to cover what is wrote before or after the badword. In the case if he write LOOK AT MY FATBONE he should has to be banned because *bone* include everything wrote before or after (isin or iswm maybe?)
But it doesn't work.
And for nicks is the same: it works if someone wear a nick that has no wildcards in list. If an user wear LUSSY he'll be banned, but if he wear BIGLUSSY , nothing happen.
I hope Ibeen more clear.
Thanks

Last edited by Fernet; Yesterday at 10:19 AM.

Link Copied to Clipboard