mIRC Homepage
Posted By: truguce Scan Nicks - 26/10/05 07:38 AM
I found this code in a different post
 on !@*:JOIN:#teenconnection: {  if (*bad* iswm $nick) ban -ku60 $chan $nick 5 Bad word in nickname
  elseif (*somethingelse* iswm $nick) ban -ku60 $chan $nick 5 Bad word in nickname}

That works for me but is there a way that you can put the words in a file and call it? Also what if they are already in the room? Can you do a scan of the nicknames and kick them if it finds one of the words from the file in their nick? Thanks
Posted By: IR_n00b Re: Scan Nicks - 26/10/05 11:35 AM
on !@*:JOIN:#teenconnection: {
if ($read(nicks.txt,nw,$+(*,$nick,*)) ban -ku60 $chan $nick 5 Bad word in nickname

just do: /write nicks.txt <bad word>
for each bad word.
Posted By: MikeChat Re: Scan Nicks - 26/10/05 03:36 PM
you might add something to scan those that are in the channel when the OP first joins
alias masscheck { who #teenconnection }

use this line to test if $6 is the nick on the network you use
raw 352:*:{ echo $active $6 }

if that is correct then replace that line with
raw 352:*:{
if ($read(nicks.txt,nw,$+(*,$6,*)) ban -ku60 $chan $nick 5 Bad word in nickname
note I didn't test that last bit, and if you have a big list you will want to use a hash table instead of a text file

Automatic scripts are not a good substitue for a reasonable thinking channel operator, dependance on them only weakens your abilities to manage things.
Also its easy to defeat a script like this by spelling the "bad word" phonetically or using numbers for letters.
Posted By: truguce Re: Scan Nicks - 26/10/05 07:21 PM
after adding this code it gave me this error
/if: invalid format (line 2, swearnick.ini)
i changed the code to this
on !@*:JOIN:#: {
  if ($read(censor.txt,nw,$+(*,$nick,*)) ban -ku60 $chan $nick 5 Bad word in nickname
Posted By: Riamus2 Re: Scan Nicks - 26/10/05 08:22 PM
You're missing a closing ).

on !@*:JOIN:#: {
  if ($read(censor.txt,nw,$+(*,$nick,*))[color:red])[/color] ban -ku60 $chan $nick 5 Bad word in nickname
Posted By: truguce Re: Scan Nicks - 26/10/05 10:27 PM
Thank you all for the help. As always it works. Thanks again
Posted By: truguce Re: Scan Nicks - 27/10/05 08:45 PM
Ok i thought I could do this. Trying to setup for a nick change. I though this was correct
on *:nick: {
  if ($read(censor.txt,nw,$+(*,$newnick,*))) ban -ku60 $chan $newnick 5 Bad word in nickname

But as ou can tell from looking at it, that is wrong. Thanks for the help.
Posted By: truguce Re: Scan Nicks - 29/10/05 08:19 AM
i have a little problem with this. for some reason when someone joined with "a" as nickname it banned him. Is this because he only used one letter in nick? If so can i fix that? This is what i have so far.
#swearnick off
on *:JOIN:#: {
  if ($read(censor.txt,nw,$+(*,$nick,*))) { ban -ku60 $chan $nick 5 Bad word in nickname. 60sec ban please change nick and rejoin. | .msg truguce $nick was banned for using bad language in nick. }

on *:nick: {
  if ($read(censor.txt,nw,$+(*,$newnick,*))) ban -ku60 $chan $newnick 5 Bad word in nickname
#swearnick end

Also can someone help with the On *:nick command cause that does not work. Thanks

Just found out when someone use ** Hello ** they got warned and kicked. I am guessing it is because of the * in my code.
Posted By: Riamus2 Re: Scan Nicks - 31/10/05 03:13 PM
Well, if you're searching for *nick* and the nick is any part of any of the "bad" words, then it will be a problem. So, any small nicks risk being banned.

If nothing else, you can throw into that IF statement...

&& $len($nick > 2)

Of course, that still risks having someone with a nick like amn being banned. But, there are probably few 3+ letter nicks that would get banned because they are part of a larger "bad" word.


There is one really bad thing with how you're doing this, though. You're looking for *nick*... Let's say a "bad" word you had was "ice." Yes, it's not a bad word, but I'd rather not start writing real ones in here and it's just an example. Anyhow, if someone's nick was "mice", it would search your bad word list for *mice* and wouldn't trigger for "ice". Think of that with how people may use swear words ... dumb*** as an example. If you put that one in your list of bad words, it would be fine... but if you just put in the * part in your list, then it would fail. Considering how many ways people use words, it would be a pain to enter every single possibility.

You're better off checking every bad word against the nick instead of the nick against every bad word. That's not a good thing to do using a text file as reading it will be a pain... you may be better off using a hash table or just sticking the words directly into the script.
© mIRC Discussion Forums