/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