mIRC Home    About    Download    Register    News    Help

Print Thread
#159329 16/09/06 01:01 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
hi guys, I want to add a line not to kick if the nick is register, is this possible?

on @*:join:#:{
if ($left($nick,-4) isalpha && $right($nick,2) isnum) {
ban -ku600 # $nick 2 14Spam Bot Detected } }

#159330 16/09/06 01:31 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It's possible, but in order to ensure that the code is written correctly we'll need the name of the network that the code is being used on. While there is a basic format that most networks use, some networks have a slightly different format when it comes to relaying the information regarding if a nick is registered or not.

#159331 16/09/06 01:33 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
RusselB I am on dalnet

#159332 16/09/06 02:02 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on @*:join:#:{
  if (($left($nick,4) isalpha) && ($right($nick,2) isnum)) {
    set %nick $nick
    set %chan  $chan
    .ns acc %nick
  }
} 
on *:notice:*acc*:*:{
  if $3 < 2 {
    ban -ku600 %chan %nick 2 14Spam Bot Detected
  }
}
  

Something I noticed, that I'm a bit curious about, you check $left($nick,-4) isalpha, which means that it's checking if the last 4 characters are alphabetic, and you check $right($nick,2) isnum, which checks for the last two characters to be numbers. Since your code requires both of these to be true, there's no way both of them can be true..one or the other, but not both.

Example:
Bairstow22 joins the channel
$left($nick,-4) = ow22
is ow22 alphabetic? No, so the first condition is false
$right($nick,2) == 22
is 22 numeric? Yes, so the second condition is true
Are both the first and second conditions true? No, so nothing else happens.

I understand about the numeric comparison, but I don't understand how you figured using $left($nick,-4) would work with it.

I didn't change it in the code, because I don't understand it, but you might want to rethink what's happening there, or let us know what you want to happen, and we'll see what we can do to fix it up.

Last edited by RusselB; 16/09/06 04:02 PM.
#159333 16/09/06 02:04 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes please fix it if you think its not right.
The code is supose to kick nicks like these here:
adbeuf22, wwwwwwww1567 or hbrkm333 and allo_99

Last edited by Garou; 16/09/06 02:07 PM.
#159334 16/09/06 02:07 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I need to know what it's supposed to do, before I can see about fixing it.

#159335 16/09/06 02:10 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes please fix it if you think its not right.
The code is supose to kick nicks like these here:
adbeuf22, wwwwwwww1567 or hbrkm333 and allo_99

#159336 16/09/06 02:20 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try my edited code. It will check nickserv registration if the nick starts with 4 letters and ends with 2 numbers, irrelevant as to what (if anything) is in between.

#159337 16/09/06 02:21 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Ok thx I will.

#159338 16/09/06 02:29 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
RusselB your codes send me a notice if the nick is register or not. What I need is for my codes not to Kick if the nick is already registered.

#159339 16/09/06 03:00 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sorry...the notice comes from nickserv whether it's a registered nick or not. The difference in the notices is the number at the end.
If that number is 0 then the nick isn't registered.
If that number is 1 then the nick isn't online or the person using the nick hasn't identified for it.
If that number is 2 then then person using the nick is on an authorized users list.
If the number is 3 then the person using the nick has identified for the nick with the password.

I corrected my code (or at least I hope I did.. LOL)

#159340 16/09/06 03:11 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
on @*:join:#:{
if ($left($nick,4) isalpha && $right($nick,2) isnum) {
set %nick $nick
set %chan $chan
.ns acc %nick
}
}
on ^*:notice:%nick acc ?:*:{
if $3 < 2 {
ban -ku600 %chan %nick 2 14Spam Bot Detected
}
}

This is wat i see [11:08] -NickServ (service@dal.net)- Erika10 ACC 0 but it does not kick those ACC 0

#159341 16/09/06 04:04 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code copied, tested, edited, tested, edited, tested (repeated until worked), edited in post.

#159342 16/09/06 07:49 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Still dont kick :P

#159343 16/09/06 07:55 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What channel are you on, and what nick are you using? Or visit me in #A-Truth-or-A-Dare on DalNet. I'll be there for at least another hour.

#159344 16/09/06 08:36 PM
Joined: Aug 2006
Posts: 44
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 44
[ 16:28:25 ] * You were kicked from #A-Truth-or-A-Dare by RusselB (4Spam Bot Detected)
-
[ 16:28:25 ] #A-Truth-or-A-Dare unable to join channel (address is banned)
-
[ 16:28:49 ] #A-Truth-or-A-Dare unable to join channel (address is banned)
-
[ 16:28:51 ] #A-Truth-or-A-Dare unable to join channel (address is banned)
-
[ 16:29:20 ] #A-Truth-or-A-Dare unable to join channel (address is banned)


it seems to be working just fine to me
and i was the test subject for this

#159345 16/09/06 08:48 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Maybe i didnt paste the right codes or something so please post the codes again?

Last edited by Garou; 16/09/06 08:54 PM.
#159346 16/09/06 08:54 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on @*:join:#A-Truth-or-A-Dare:{
  set %nick $nick
  if (($left(%nick,4) isalpha) &amp;&amp; ($right(%nick,2) isnum)) {
    set %chan  $chan
    .ns acc %nick
  }
} 

on *:notice:*acc*:*:{
  if $3 &lt; 2 {
    ban -ku600 %chan %nick 2 4Spam Bot Detected
  }
}
 

#159347 16/09/06 09:02 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
It works fine I forgot to add my channel.
I know am a dork.
Thx guys.


Link Copied to Clipboard