clone scanner

Paste Your small code(s) here, ex. small aliases, identifiers

clone scanner

Postby vodkaplayer » Sun Jul 27, 2008 7:51 am

usage:
/scanclone #chan
//say $scanclone(#chan)

this code work without $ialchan wich is heavy slower
I just add evey host in a hash table and all associated nicknames.
the IAL is updated alone if it's not.
put show.clone to 1 to show the clones
tested on mIRC 6.31

#cod4.wars on Quakenet:
Found 297 clones divided on 124 host in 1160 users, 25.6% of clones (Real user: 863). 266 ms.

Code: Select all
alias -l show.clone { return 0 }
alias scanclone {
  if (!$1) { echo -a you must specify a channel | return }
  if ($me !ison $1) { echo -a I'm not on $1 | return }
  if (!%scantime) { set %scantime $ticks }
  if ($isid) && (!%isid) { set %isid 1 }
  if (!$chan($1).ial) && (!$chan($1).inwho) { .enable #EOW | raw -q WHO $1 | return }
  if ($chan($1).inwho) { .enable #EOW | return }
  var %i = 1, %h,%n, %t = %scantime | hmake clone 1000
  while ($nick($1,%i)) { var %n = $nick($1,%i).pnick, %h = $ial($v1).host
    hadd clone %h $iif($hget(clone,%h),$v1) %n | inc %i
  }
  var %i = 1, %a = 0, %r = $hget(clone,0).item, %c = $calc($nick($1,0) - %r)
  while ($hget(clone,%i).data) { if ($numtok($v1,32) > 1) {
      var %n = $v1 | inc %a | if ($show.clone == 1) && (!$isid) {
        echo -a %a $+ :4 $hget(clone,%i).item : $+ %n  $sorttok($hget(clone,%i).data,32,c)
      }
    }
    inc %i
  }
  hfree clone | unset %scantime %isid
  /$iif($isid,return,echo -a) $1 Found %c clones divided on %a host in $nick($1,0) users, $&
    $round($calc((%c / $nick($1,0)) *100),2) $+ % of clones (Real user: %r $+ ). $calc($ticks - %t) ms.
}
#EOW off
raw 315:& & End of /WHO list.: { .disable #EOW | $iif(%isid,msg $2 $scanclone($2),/scanclone $2) }
#EOW end


Attachments
scanclone.rar
//extract to your mIRC directory and
/load -rs scanclone.mrc
(693 Bytes) Downloaded 315 times
Last edited by vodkaplayer on Tue Jul 29, 2008 6:52 pm, edited 1 time in total.
vodkaplayer
 

Re: clone scanner

Postby Cristian » Sun Jul 27, 2008 10:59 am

Beautiful work, I love the use of hash tables.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: clone scanner

Postby Futz0r » Mon May 18, 2009 8:37 pm

The selected attachment does not exist anymore.

The file ./../files/92_beaeb9e60f78bdf9fa7769429a0d5b85 does not exist.


:(

i want to see this script in action! :D
Futz0r
 

Re: clone scanner

Postby Blady » Mon May 18, 2009 8:47 pm

Just copy/paste the following code in your remote and then, /scanclone #channel

Code: Select all
alias -l show.clone { return 0 }
alias scanclone {
  if (!$1) { echo -a you must specify a channel | return }
  if ($me !ison $1) { echo -a I'm not on $1 | return }
  if (!%scantime) { set %scantime $ticks }
  if ($isid) && (!%isid) { set %isid 1 }
  if (!$chan($1).ial) && (!$chan($1).inwho) { .enable #EOW | raw -q WHO $1 | return }
  if ($chan($1).inwho) { .enable #EOW | return }
  var %i = 1, %h,%n, %t = %scantime | hmake clone 1000
  while ($nick($1,%i)) { var %n = $nick($1,%i).pnick, %h = $ial($v1).host
    hadd clone %h $iif($hget(clone,%h),$v1) %n | inc %i
  }
  var %i = 1, %a = 0, %r = $hget(clone,0).item, %c = $calc($nick($1,0) - %r)
  while ($hget(clone,%i).data) { if ($numtok($v1,32) > 1) {
      var %n = $v1 | inc %a | if ($show.clone == 1) && (!$isid) {
        echo -a %a $+ :4 $hget(clone,%i).item : $+ %n  $sorttok($hget(clone,%i).data,32,c)
      }
    }
    inc %i
  }
  hfree clone | unset %scantime %isid
  /$iif($isid,return,echo -a) $1 Found %c clones divided on %a host in $nick($1,0) users, $&
    $round($calc((%c / $nick($1,0)) *100),2) $+ % of clones (Real user: %r $+ ). $calc($ticks - %t) ms.
}
#EOW off
raw 315:& & End of /WHO list.: { .disable #EOW | $iif(%isid,msg $2 $scanclone($2),/scanclone $2) }
#EOW end


HF! :]
Blady
 

Re: clone scanner

Postby Futz0r » Mon May 18, 2009 8:53 pm

heh..


okay i'll do it :)

and thanks
Futz0r
 


Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 0 guests

cron