mIRC Home    About    Download    Register    News    Help

Print Thread
S
shinjii
shinjii
S
I sort of whipped this on the fly and it dosent work, so if anyone has an idea of how to fix it or better code it, do let me know plz.


;For New Drone Checker
if (%CDrones1. [ $+ [ $chan ] ] == ON) || (%CDrones1.all == ON) {
unset %identonly
set %identonly $gettok($gettok($address($nick,5),1,64),2,33)
if (%identonly == $nick) && ($left($nick,1) !isnum) && ($right($nick,-1) isnum 10-99) {
if $nick ison $chan {
.ban -ku120 # $nick 2 «Rdk©» [Auto] Network Abusive Drones Not Welcome, Please try again Tommorow.
}
goto end
}
;If the Nick didnt match the Numeric Drones then Check the Real Name by doing a /who on the nick
;set %SupNick. $+ $nick ON
;who $nick
}
:end
}

Joined: Dec 2002
Posts: 143
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 143
One thing I noticed, you are using "isum" incorrectly.

($right($nick,-1) isnum 10-99)

($right($nick,-1) >= 10) && ($right($nick,-1) <= 99)

D
DaveC
DaveC
D
($right($nick,-1) isnum 10-99) is the correct format, where have you been sleeping during class?

C
captain_comic
captain_comic
C
When I look at my $address, I see: sHiFt!~sHiFt@xx.xx.xxx.x
The first $gettok (which uses 64 as separator) gives me sHiFt!~sHiFt@xx and the second $gettok (with 33) gives me ~sHiFt@xx and that doesn't look like a nick. A better way, I think, is to use $pos.

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Er... that doesn't look like a nickname because it's your ident? confused

Try something like:

//echo -a Nick: $gettok($gettok($address($me,5),1,64),1,33)
//echo -a Ident: $gettok($gettok($address($me,5),1,64),2,33)

D
DaveC
DaveC
D
Quote:
When I look at my $address, I see: sHiFt!~sHiFt@xx.xx.xxx.x
The first $gettok (which uses 64 as separator) gives me sHiFt!~sHiFt@xx and the second $gettok (with 33) gives me ~sHiFt@xx and that doesn't look like a nick. A better way, I think, is to use $pos.


Since when did $chr(64) become a "." !?!??!?!?!?!?!!?
64 = @ getting resulting in sHiFt!~sHiFt and 33 is ! resulting in ~sHiFt which is the part he wants (I assume)


And on the original problem of why the script wont work...
Code:
set %identonly $gettok($gettok($address($nick,5),1,64),2,33)
if (%identonly == $nick) &amp;&amp; ($left($nick,1) !isnum) &amp;&amp; ($right($nick,-1) isnum 10-99) { 
  if $nick ison $chan { 
  .ban -ku120 # $nick 2 «Rdk©» [Auto] Network Abusive Drones Not Welcome, Please try again Tommorow.
  } 


I dont know why hes checking if the nick matches the USER (ident?) portion of the address, maybe all the real bots have this set the same as the nick?!?!?
The rest looks ok I guess i assume the real bots are x10!x10@xxx.xxx.xxx.xxx to x99!x99@xxx.xxx.xxx.xxx so if u dont match that you dont get kicked cause ya not a bot.

The thing I think might be causing the problem may be how hes calling this script into running, is it event driven or command line or timer ? He never showed us the method of activating.

Joined: Dec 2002
Posts: 143
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 143
Yap! I must have been on this one. blush

Joined: Dec 2002
Posts: 143
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 143
Hopefuly I'm awake this time.

set %identonly $gettok($gettok($address($nick,5),1,64),2,33)
if (%identonly == $nick)

If the user is not properly identified, $nick will never equal ~userid.

I previously solved that problem by removing ~ from the userid as follows:

set %identonly $remove($gettok($gettok($address($nick,5),1,64),2,33),~)

C
captain_comic
captain_comic
C
Quote:
Since when did $chr(64) become a "." !?!??!?!?!?!?!!?

err .. you're right, the only problem with the code was that it also looked at ~ which indeed is part of the ident and that was what I meant in fact smirk

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Yes you are awake. grin

Why don't you use something like..

Code:
alias -l ident { 
  return $remove($gettok($gettok($address($1,5),2,33),1,64),~)
}

On @*:Join:#: {
  if ($ident($nick) == $nick) { do stuff }
}

S
shinjii
shinjii
S
Quote:


I dont know why hes checking if the nick matches the USER (ident?) portion of the address, maybe all the real bots have this set the same as the nick?!?!?
The rest looks ok I guess i assume the real bots are x10!x10@xxx.xxx.xxx.xxx to x99!x99@xxx.xxx.xxx.xxx so if u dont match that you dont get kicked cause ya not a bot.




Yes the drones that r affecting are usually in the form x10!x10@xxx.xxx.xxx.xxx to x99!x99@xxx.xxx.xxx.xxx .. my coding is admittedly not my strong suit since i merly through a few things together, but all help is appreciated so far.

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
You could try something like this perhaps?

Code:
menu channel {
  $iif($dialog(ident),$style(7)) Ident: { dialog -dmo ident ident }
}

dialog ident {
  title "Idents"
  size -1 -1 100 121
  option dbu
  list 1, 1 1 98 83, size sort
  button "Add", 2, 18 91 30 9
  button "Del", 3, 51 91 30 9
  button "Close", 4, 3 109 95 9
}

alias ident { 
  return $remove($gettok($gettok($address($1,5),2,33),1,64),~)
}

On @*:Join:#:{ 
  if ($ident($nick) == $read(ident.txt,w,$+(*,$nick,*))) { ban -ku120 $chan $nick 3 Ident $+($chr(2),$v1,$chr(2)) matched nickname $+($chr(2),$nick,$chr(2)) $+ . }
}

on 1:dialog:ident:init:*: {
  if ($exists(ident.txt)) {
    var %x = $lines(ident.txt)
    while (%x) {
      did -a ident 1 $read(ident.txt,%x)
      dec %x
    }
  }
}

on 1:dialog:ident:sclick:1: { 
  set %ident.sel $did(1,$did(1).sel)
  did -e ident 3
}

on 1:dialog:ident:sclick:2: {
  dialog -n ident ident
  set %ident.add $input(Enter nickname to add:,e,Add nickname)
  did -a ident 1 %ident.add
  write ident.txt %ident.add
  dialog -o ident ident
}

on 1:dialog:ident:sclick:3: { 
  did -d ident 1 $did(ident,1).sel 
  write -dw $+("*,%ident.sel,*") ident.txt
  did -b ident 3
} 

on 1:dialog:ident:sclick:4: { 
  dialog -x ident ident
}

on 1:dialog:ident:close:*: {
  unset %ident.*
}


Simply so you don't have to keep using || (or) to check multiple idents it will store in a text file for you to add to it or remove entries.

Right click in a channel, select Ident. And away you are.

When a user gets banned it'd look like this.


[15:09] * Andy has joined #Andy
[15:09] * ChanServ sets mode: +o Andy
[15:09] * test sets mode: +b *!*andy@*.MysticIRC.co.uk
[15:09] * Andy was kicked by test (Ident andy matched your nickname Andy.)


Hope this helps.

All the best,

-Andy.

Joined: Dec 2002
Posts: 143
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 143
Didn't think creating an identifier was necessary ... here's mine for the "on join" event :

on @*:join:#: {
if ($nick == $remove($gettok($gettok($fulladdress,1,64),2,33),~)) {
do stuff
}
}

S
shinjii
shinjii
S
OK taking into consideration i forgot to add a way of calling the code .. thi sis the latest version of the code im working on.

on *:join:#:{
if $me !isop $chan goto end
if $nick == $me goto end
;For New Drone Checker
if (%CDrones1. [ $+ [ $chan ] ] == ON) || (%CDrones1.all == ON) {
unset %identonly
set %identonly $remove($gettok($gettok($address($nick,5),1,64),2,33),~)
if (%identonly == $nick) && ($left($nick,1) !isnum) && ($right($nick,-1) isnum 10-99) {
if $nick ison $chan {
.ban -ku120 # $nick 2 «Rdk©» [Auto] Network Abusive Drones Not Welcome, Please try again Tommorow.
}
goto end
}
;If the Nick didnt match the Numeric Drones then Check the Real Name by doing a /who on the nick
;set %SupNick. $+ $nick ON
;who $nick
}
:end
}


Link Copied to Clipboard