mIRC Homepage
Posted By: learn3r help please - 30/12/06 04:54 AM
(on join only)
Anyone know how to make a anti bad nick/ident kicker


if I have bad.txt that contains bad words stuff....

thanks
Posted By: SICORPS Re: help please - 30/12/06 07:27 AM
here's what iam using on undernet network because there is a lots of spam bot out there so i made this litle script on join.

Code:

on @*:JOIN:#: {
  if ($nick == $me) { halt }
  if ($right($nick,2) isnum 10-46) && ($ulist($address($nick,2)).info == $null) { if (*.users.undernet.org !iswm $address($nick,2)) && ($right($nick,3) !isnum 47-99999) { inc -u20 %x | inc %kc | var %k = $nick | timer.kick.spam.bot. $+ $nick 1 %x kick $chan %k $zx anti-spam kick num:[12 $+ %kc $+ ] | halt } }
}



u could always ur spam.txt nick list like this :

Code:

on @*:JOIN:#:{ inc -u20 %x | inc %kc | if $nick isin $read(bad.txt, s, $nick) timer.spam. $+ $nick 1 %x kick $chan $nick spam-kick no: $+ %kc | halt }

Posted By: learn3r Re: help please - 30/12/06 10:37 AM
on @*:JOIN:#:{ inc -u20 %x | inc %kc | if $nick isin $read(bad.txt, s, $nick) timer.spam. $+ $nick 1 %x kick $chan $nick spam-kick no: $+ %kc | halt }

-------
aint working....

and the bad.txt contains
sample :
gay
fuck
-------

same goes to the ident...
Posted By: learn3r Re: help please - 01/01/07 09:26 AM
Isn't there anyone who knows this.. pls help...

Thank You & happy new year to all
Posted By: Scripto Re: help please - 01/01/07 05:34 PM
This is 1 possibility to try:

Ive always found it difficult to use .txt files to evaluate a "bad" nickname on Join because you have to pinpoint the "bad" token in the $nick (ex: gay_101, No1_gay, 1_gay_1 etc.) in order for the $read identifier to evaluate a match in the textfiles' list of words.

mIRC must evaluate an exact match between the "bad" token and the .txt file word, or your kicker wont trigger.

Including the realname in this kicker adds another token search to conduct, making this type of kicker a bit messy to code cleanly.

So to avoid lengthy code heres what I would try:
Code:
 on *:JOIN:#: {
   if ($nick == $me) halt
   if ((gay isin $nick) || (gay isin $gettok($address,1,64))) { /kickbad $chan }
   if ((sex isin $nick) || (sex isin $gettok($address,1,64))) { /kickbad $chan }
}
alias -l kickbad {
  /ban $1 $address($nick,2)
  /kick $1 $nick Unacceptable Word In Nick/Ident.
}

This will kick any nickname or realname with the words gay or sex in them.

Try creating one script that has all the words you dont want in it, if you find a new word that youre not comforable with, just write a new line in the Join trigger for that token like gay or sex is above. Every line will resort to the single alias at the bottom if it evaluates to kick.

This script can be a mile long, with any words you can think of and still give you the instant trigger result youre looking for (vs. searching a .txt file., in which I have seen cases of over 15 thousand lines, and still have instant responses with my pc)

Good luck grin
Posted By: sparta Re: help please - 01/01/07 05:42 PM
This is something i write a while ago, maybe it's something for you, add the "bad words" in a txt file named badwords.txt, then type: /set %word.kick on .. and ur ready to go, disable the kick is done by: /set %word.kick off .. If you want to kick oped and voiced users too, remove the lines:

if ( $nick isop $chan ) { halt }
if ($nick isvo $chan) { halt }

You can add as many words you like in the txt file, and can be changed to kick nick using the badword too. and not with so much work, good luck. smile

Code goes in your remote.. ALT + R in your mirc.
Code:
on @*:text:*:#:{
  if ( $nick isop $chan ) { halt }
  if ($nick isvo $chan) { halt }
  if (%word.kick == On) {
    set %badword.line 1
    :badword
    if ( $read -l $+ %badword.line " $+ $mircdir\badwords.txt $+ " == $null ) { halt }
    elseif ( $read -l $+ %badword.line $mircdir $+ \badwords.txt isin $1- ) { goto badwordkick }
    else { inc %badword.line | goto badword }
    :badwordkick
    kick # $nick Do not use that language here!
    else { halt }
    :end
  }
}
Posted By: learn3r Re: help please - 02/01/07 08:43 AM
Thanks Scripto

I have that kind of code
i just want something new and will only read the .txt for the bad nick/ident

how about var %badndent = pussy,dick,gay
?
Posted By: learn3r Re: help please - 02/01/07 08:45 AM
Thanks sparta
I'll try this code to my bad nick / Ident
if it'll work hehehe
Posted By: learn3r Re: help please - 02/01/07 12:12 PM
Code:
on *:JOIN:#: {
  set %badword.line 1
  :badword
  if ( $read -l $+ %badword.line " $+ $mircdir\badwords.txt $+ " == $null ) { halt }
  elseif ( $read -l $+ %badword.line $mircdir $+ \badwords.txt isin $gettok($address($nick,15),1,64)) ) { goto badwordkick }
  else { inc %badword.line | goto badword }
  :badwordkick
  kick # $nick Do not use that language here!
  else { halt }
  :end
}


I tried that but it kicks all who joins my chan frown
Posted By: Sais Re: help please - 02/01/07 03:08 PM
Quote:
I tried that but it kicks all who joins my chan

That would be because it executes the kick each time the on join is executed unless it gets halted by the $read being $null.

Sparta: Please, please, read up on 1) /help $read and 2) /help /while :]

Code:
var %badword = $read(badwords.txt,nt,%badword.line)
;; Doing it for nick and user parts of the address separately:
if (%badword isin $nick || %badword isin $ial($nick).user) { ... }
;; Doing it for nick and user parts of the address in one:
if (%badword isin $gettok($fulladdress,1,64)) { ... }


I would either do the kick in the while loop, or set a flag:

Code:
var %n = $lines(badwords.txt)
;; option 1
while (%n) {
  if ($read(...)) { kick ... }
  dec %n
}

;; option 2
var %flag = $false
;; the && !%flag here is optional - if it's not present, it will always run through the entire file, which may be useful for some applications
while (%n && !%flag) {
  if ($read(...)) { %flag = $true }
  dec %n
}
if (%flag) { kick .... }


These are obviously just templates, I leave it up to you, dear reader, to implement them as you see fit!
Posted By: learn3r Re: help please - 02/01/07 05:39 PM
Code:
on *:JOIN:#: {
  if ($me isop #) {
    set %badword.line 1
    :badword
    var %badword = $read(badwords.txt,nt,%badword.line)
    if (%badword isin $gettok($fulladdress,1,64)) { goto badkick }
    else { inc %badword.line | goto end }
    :badkick |  kick # $nick Bad nick/ident
    :end | halt
  }
}


I did that but still doesn't work...
What do i have to do w/ this?


And how about this?
Code:
on @*:join:#: {
  var %flag = $false
  while (%n && !%flag) {
    if ($read(badwords.txt) isin $gettok($fulladdress,1,64))  { %flag = $true }
    dec %n
  }
  if (%flag) { kick .... }
}

on @*:join:#: {
  var %n = $lines(badwords.txt)
  while (%n) {
    if ($read(badwords.txt) isin $gettok($fulladdress,1,64)) { kick ... }
    dec %n
  }
}
Posted By: learn3r Re: help please - 03/01/07 02:00 AM

HEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLP
Posted By: RusselB Re: help please - 03/01/07 04:52 AM
Try this
Code:
on *:join:#:{
  .enable #bad_ident_nick_scan
  .who $nick
}
#bad_ident_nick_scan off
raw 315:*:{
  .disable #bad_ident_nick_scan
  haltdef
}
raw 352:*:{
  if $read(bad.txt,s,$3) || $read(bad.txt,s,$6) {
    if $me isop $2 {
      .ban -k $2 $6 Banned due to bad nick or ident
    }
    else {
      set %bad $addtok(%bad,$6,32)
    }
  }
}
#bad_ident_nick_scan end
on *:op:#:{
  if $opnick == $me && %bad {
    var %a = 1, %b = $numtok(%bad,32)
    while %a <= %b {
      if $gettok(%bad,%a,32) ison $chan {
        ban -k $chan $gettok(%bad,%a,32) Banned due to bad nick or ident
      }
      inc %a
    }
    unset %bad
  }
}
Posted By: learn3r Re: help please - 03/01/07 06:56 AM
that doesnt seem to work either russelB


I thought this should work but still doesnt frown
Code:
alias badtxt return $+(",$scriptdirbadword.txt")
alias badchan { if ($1 isin $bad($2).type) || (!$bad($2).type) { return $true } }
alias bad {
  if ($1) {
    if ($prop == type) {
      %s = 1
      while (%s <= $lines($badtxt)) {
        if ($gettok($read $+(-l,%s) $badtxt,1,44) iswm $1) { return $gettok($read $+(-l,%s) $badtxt,2-,44) | halt }
        inc %s
      }
      unset %s
    }
    else {
      %s = 1
      while (%s <= $lines($badtxt)) {
        if ($gettok($read $+(-l,%s) $badtxt,1,44) iswm $1) { return $gettok($read $+(-l,%s) $badtxt,1,44) | halt }
        inc %s
      }
      unset %s
    }
  }
}
on *:join:#:{
  if ($bad($fulladdress)) && ($badchan(#,$fulladdress)) {
    if ($me isop $chan) {
      kick # $nick Bad Nick/Ident
    }
    else ($me !isop $chan) { return }
  }
}
Posted By: RusselB Re: help please - 03/01/07 08:11 AM
I apologize that mine doesn't work, I (obviously) thought it would, as it uses the nick and ident information returned by the /who command.

In regards to the code you posted, there are some coding errors.
Here's a re-write of your code, with detected coding errors corrected, and condensed.
Code:
alias badtxt return $+(",$scriptdirbadword.txt,")
alias badchan { if ($1 isin $bad($2).type) || (!$bad($2).type) { return $true } }
alias bad {
  if ($1) {
    var %s = 1, %lines = $lines($badtxt)
    while (%s <= %lines) {
      var %line = $read($badtxt,%s)
      if ($gettok(%line,1,44) iswm $1) {
        return $iif($prop == type,$gettok(%line,2-,44),$v1)
        inc %s   
      }
    }
  }
}
on @*:join:#:{
  if ($bad($fulladdress)) && ($badchan(#,$fulladdress)) {
    kick # $nick Bad Nick/Ident
  }
}

Posted By: learn3r Re: help please - 03/01/07 09:04 AM
frown still ain't working...

Can someone do this even if not using a .txt

instead is

var %bad = fuck,gay,bitch,cock


Thank You guys for helping
Posted By: RusselB Re: help please - 03/01/07 09:47 AM
I'm going to hope that this is a question I didn't need to ask, but in the text file, do you have the items one per line, or do you have them all on one line, and separated by commas (like you show for the variable)?

I tested my script, using a text file with one item per line, and it worked exactly as expected.
Posted By: learn3r Re: help please - 03/01/07 10:30 AM
text file is like this

fuck
dick
gay


(and i hope it'll kick like nick : gay_01 or ident: 01gay)

and I tried it just now and it crashes my mIRC ...
Posted By: Bundy Re: help please - 03/01/07 12:09 PM
I think it should look like this then:

*one*
*two*
*three*

Please correct me if I'm wrong!

Regards,

b

ps: thats not a script for a sex channel, now is it?! grin
Posted By: sparta Re: help please - 03/01/07 01:16 PM
Code:
on @*:JOIN:#: {
  if (%badnick == on) {
    if ($nick == $me) { halt }
    :loop1
    inc %crap.nick 1
    var %nick.crap $read -l $+ %crap.nick $mircdir\badnicks.txt
    if (%nick.crap == $null) { goto loop2 }
    if (%nick.crap isin $nick) {
      if (%badnick.ban == on) ban -u [ $+ [ %badnick.time ] ] # $nick 3
      kick $chan $nick That was a bad nick.
      goto loop2
    }  
    goto loop1
    :loop2
    unset %crap.nick
  }
}

set %badnick on <- to enable this.
set %badnick.ban on <- if you also want to ban the user.
set %badnick.time 60 <- the ban will last for 1 minute.
all nick's u want to kick on should be stored in the file 'badnicks.txt'

I think this will work, untested tho...
Posted By: Scripto Re: help please - 03/01/07 03:20 PM
oh, heh, $fulladdress <~~ ya... cool use that.
Posted By: learn3r Re: help please - 03/01/07 04:25 PM
This one works....

Thanks sparta!!!!:D

and thank you guys laugh

Appreciated all your help
Posted By: sparta Re: help please - 03/01/07 04:25 PM
No problem smile
Posted By: sparta Re: help please - 26/05/07 06:31 AM
Didnt see this untill now.. smirk i dont know why i should change the code? smile since the script does what it's supposed to and i never had a problem with the code, then i leav it as it is.. smile and by the way, i use the same code for "bad nick and bad ident" smile working as a charm smile
© mIRC Discussion Forums