mIRC Homepage
Posted By: shinjii Nick check against mIRC username - 24/03/05 02:43 PM
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
}
Posted By: gemeau50 Re: Nick check against mIRC username - 24/03/05 05:17 PM
One thing I noticed, you are using "isum" incorrectly.

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

($right($nick,-1) >= 10) && ($right($nick,-1) <= 99)
Posted By: DaveC Re: Nick check against mIRC username - 24/03/05 07:24 PM
($right($nick,-1) isnum 10-99) is the correct format, where have you been sleeping during class?
Posted By: captain_comic Re: Nick check against mIRC username - 24/03/05 09:22 PM
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.
Posted By: SladeKraven Re: Nick check against mIRC username - 24/03/05 09:36 PM
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)
Posted By: DaveC Re: Nick check against mIRC username - 25/03/05 12:02 AM
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.
Posted By: gemeau50 Re: Nick check against mIRC username - 25/03/05 02:38 AM
Yap! I must have been on this one. blush
Posted By: gemeau50 Re: Nick check against mIRC username - 25/03/05 04:00 AM
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),~)
Posted By: captain_comic Re: Nick check against mIRC username - 25/03/05 07:49 AM
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
Posted By: SladeKraven Re: Nick check against mIRC username - 25/03/05 01:59 PM
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 }
}
Posted By: shinjii Re: Nick check against mIRC username - 25/03/05 02:11 PM
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.
Posted By: SladeKraven Re: Nick check against mIRC username - 25/03/05 03:12 PM
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.
Posted By: gemeau50 Re: Nick check against mIRC username - 25/03/05 03:15 PM
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
}
}
Posted By: shinjii Re: Nick check against mIRC username - 27/03/05 12:29 PM
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
}
© mIRC Discussion Forums