mIRC Home    About    Download    Register    News    Help

Print Thread
#168075 03/01/07 04:17 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
Hello and Happy New Year!

I have the following code:
Code:
on !^*:join:#: {
  set %scannumber
  set %clonenicks
  :start
  inc %scannumber
  if ($nick(#,%scannumber) == $null) { goto end }
  elseif ($nick == $nick(#,%scannumber)) { goto start }
  elseif ($address($nick,2) == $address($nick(#,%scannumber),2)) { /set %clonenicks %clonenicks $nick(#,%scannumber) | goto start }
  else goto start
  :end
  if (%clonenicks != $null) { haltdef | .echo $chan 4*** Joins: $nick ( $+ $address $+ ) 15Clone(s): 4 %clonenicks } 
  unset %scannumber %clonenicks
}


(it's not made by me. I have it for a long time, and I dont remember where I got it in order to credit it.)

I need this script to scan by the "real name"...
I am on a server that has this whois format:
Quote:
Nick is ~indent@host * [IP] chat user

so the IP would be $6 in raw 311.

I tried something like this:
Code:
raw 352:*:{ 
  on !^*:join:#: {
    set %scannumber
    set %clonenicks
    :start
    inc %scannumber
    if ($nick(#,%scannumber) == $null) { goto end }
    elseif ($nick == $nick(#,%scannumber)) { goto start }
    elseif ($remove($9,[,]) == $remove($9,[,])($nick(#,%scannumber),2)) { /set %clonenicks %clonenicks $nick(#,%scannumber) | goto start }
    else goto start
    :end
    if (%clonenicks != $null) { haltdef | .echo $chan 4*** Joins: $nick ( $+ $remove($9,[,]) $+ ) 15Clone(s): 4 %clonenicks } 
    unset %scannumber %clonenicks
  }
}

but of course it doesn't work cause I dont know the syntax for this line:
Code:
elseif ($address($nick,2) == $address($nick(#,%scannumber),2)) { /set %clonenicks %clonenicks $nick(#,%scannumber) | goto start }
to make it search by $6 in raw 311.

if you can help it would be apreciated...


yetti #168084 03/01/07 05:21 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
For a RAW, you use:
Code:
RAW 311 {
  if ($6 == whatever) {
    do this
  }
}


But, if you want to get the data from whois, you'll have to whois the people using the script and then go from that.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #168090 03/01/07 05:38 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
I want to scan a channel for clones and compare the "real name" ($fullname) because on the network I use, the IP is there and not in $address. If you read again my first post you will see..

thanks

yetti #168096 03/01/07 06:46 PM
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
$6 on raw 311 is the 'fullname' field.

It returns a different value than the 'realname' field that is the Identd (the User Id) which is in the first part of any address.

Which were you asking to find clones of ?



Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Scripto #168135 04/01/07 07:13 AM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
Originally Posted By: Scripto
$6 on raw 311 is the 'fullname' field.

It returns a different value than the 'realname' field that is the Identd (the User Id) which is in the first part of any address.

Which were you asking to find clones of ?



this is an example on how the network returns a whois (first line):
Quote:
larysa17 is ~54f73bc5@irc.apropo.ro * [84.247.59.197] Apropo chat user

in raw 311 $6 is [84.247.59.197] witch I strip using $remove($6,[,]) to give me the actual IP

I need the clone scaner (in my first post, first code is a working clone scaner) that will use this instead of $address and/or ial

yetti #168137 04/01/07 10:55 AM
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
You would have to collect this information in the 311 event - that means that you do it at the same time as the code in your 352 event handler.

You would have to have a way of storing that information somewhere.

I'd suggest using a hash table with the ip as an index, and nick as the data.

I guess you would have to maintain that on quits/parts/kicks, too...

When you find someone joining whose ip is already in the hash, you know it's a clone. (and it means you only need to check the 311 return, unless I'm mistaken)

Maybe I'll show you what I mean in a script if I get a little time spare.


Sais
Sais #168147 04/01/07 02:13 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Which is what I suggested in the first place (using RAW 311). Heh.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #168153 04/01/07 04:20 PM
Joined: Dec 2006
Posts: 80
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
If 352 returns the ip info, you could just use 352 for the whole script. who the channel to fill the hash table, then who everyone who joins, gets kicked, parts and... heh, does a whowas return that IP info after a quit? confused If not, that part would be kinda tricky. I guess it would make a difference on what part was the item, and what part was the data....

*~* wanders away pondering thought *~*


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Scripto #168213 05/01/07 11:40 AM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
Unfortunatly I dont know anything about hash tables thingy smile

If the "on join" clone script is to tricky, would it be easyer to make the scaner check for clones manualy?

ex: if i want to check a nick, i'll just do: "/scan nick" and then it will scan the whole channel and return an answer..

yetti #169118 19/01/07 04:32 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
*bump*

?

yetti #169776 27/01/07 09:31 PM
Joined: Jan 2004
Posts: 162
R
RRX Offline
Vogon poet
Offline
Vogon poet
R
Joined: Jan 2004
Posts: 162
Doing a /whois on every user in the channel is quite some work to avoid flooding and too unresponsive mIRC.
Some networks allow to do /whois nick1,nick2,nick3 etc.

I wrote something to do this but it's quite complicated, part of a bigger script, and requires alot initial configuration work, it's downloadable from http://www.hawkee.com/view.php?file_id=1363 or for latest version, http://home.deds.nl/~cq/ServCom/ServCom.zip

- file SC_XIRC.mrc / alias SC_IRC_CheckMassSupport checks if the network supports mass whois.

- file SC_XIRC.mrc / the part under ; IRC / COMMAND QUEUE is a single parameter command queue to irc servers, here used for /whois nick or /whois nick nick (called "special whois")

- file SC_XIRC.mrc / the part under ; IRC / MASS COMMAND QUEUE is the queue that converts a stream whois requests on one nick to a series mass whois commands.

Both queues are processed using a "send command to irc server - wait for response to do next command" technique, with a configurable timeout (to avoid occasional stalls) and delay (to avoid mIRC too unresponsive).

- file SC_XIRCEvents.mrc holds all the events that may be triggered in response to the given commands, in your case ; +++ RAW EVENTS / WHOIS and maybe also under ; +++ RAW EVENTS / SERVER RELATED for server too busy.

I realize this all doesnt help you much directly regarding code, but it may help in the way of knowing the problems and how to deal with them.


Link Copied to Clipboard