|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
(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
learn learn learn
|
|
|
|
Joined: Dec 2006
Posts: 9
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Dec 2006
Posts: 9 |
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.
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 :
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 }
Last edited by SICORPS; 30/12/06 07:28 AM.
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
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...
learn learn learn
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
Isn't there anyone who knows this.. pls help...
Thank You & happy new year to all
learn learn learn
|
|
|
|
Joined: Dec 2006
Posts: 80
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
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: 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 grin](/images/graemlins/mirc/grin.gif)
Last edited by Scripto; 01/01/07 05:46 PM.
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
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 smile](/images/graemlins/mirc/smile.gif) Code goes in your remote.. ALT + R in your mirc.
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
}
}
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
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 ?
learn learn learn
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
Thanks sparta I'll try this code to my bad nick / Ident if it'll work hehehe
learn learn learn
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
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 frown](/images/graemlins/mirc/frown.gif)
learn learn learn
|
|
|
|
Joined: Oct 2003
Posts: 313
Fjord artisan
|
Fjord artisan
Joined: Oct 2003
Posts: 313 |
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 :]
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:
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!
Sais
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
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?
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
}
}
Last edited by learn3r; 02/01/07 06:13 PM.
learn learn learn
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
HEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLP
learn learn learn
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Try this 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
}
}
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
that doesnt seem to work either russelB I thought this should work but still doesnt ![frown frown](/images/graemlins/mirc/frown.gif)
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 }
}
}
learn learn learn
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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. 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
}
}
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
![frown frown](/images/graemlins/mirc/frown.gif) 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
learn learn learn
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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.
|
|
|
|
Joined: Oct 2006
Posts: 342
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2006
Posts: 342 |
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 ...
Last edited by learn3r; 03/01/07 10:39 AM.
learn learn learn
|
|
|
|
Joined: Dec 2005
Posts: 54
Babel fish
|
Babel fish
Joined: Dec 2005
Posts: 54 |
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 grin](/images/graemlins/mirc/grin.gif)
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
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...
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
|