alias clonescan {
var %chan = $iif($left($1,1) == $chr(35),$1,#), %type = $iif($2,$2,$iif($left($1,1) == -,$1))
if ($dialog(clonescanner) == $null) && (%type != -a) { dialog -m clonescanner clonescanner }
if (%chan !ischan) {
if (%type == -a) { echo $colour(info) -a * Please enter a valid channel, ie. a channel that you are in. | return }
else { did -ra clonescanner 4 Please enter a valid channel, ie. a channel that you are in. | return }
}
if ($chan(%chan).ial != $true) {
.ial on
if (%type == -a) { echo $colour(info) -a * Updating IAL for %chan }
else { did -ra clonescanner 4 Updating IAL for %chan $+ ... }
set %cs.chan $addtok(%cs.chan,%chan,32) | raw -q WHO %chan | set %cs.type %type | return
}
else {
if ($dialog(clonescanner)) { did -r clonescanner 2 | dialog -t clonescanner VTEC §cript GOLD ® Clone Scanner - scanning %chan }
if ($hget(cs)) { hfree cs }
hmake cs $nick(%chan,0)
var %i = 1, %ticks = $ticks, %clones
while ($nick(%chan,%i)) { hadd cs $address($nick(%chan,%i),2) $hget(cs,$address($nick(%chan,%i),2)) $iif($numtok($hget(cs,$address($nick(%chan,%i),2)),38) > 0,$chr(38)) $nick(%chan,%i) | inc %i }
var %o = 1
if (%type == -a) { echo -a - | echo -a * Clone Scan in %chan }
while ($hget(cs,%o).item) {
if ($numtok($hget(cs,$hget(cs,%o).item),38) > 1) {
if (%type == -a) { echo -a $numtok($hget(cs,$hget(cs,%o).item),38) => $hget(cs,%o).item $+ : $hget(cs,$hget(cs,%o).item) }
else { did -a clonescanner 2 $hget(cs,%o).item ( $+ $numtok($hget(cs,$hget(cs,%o).item),38) $+ ): $hget(cs,$hget(cs,%o).item) | did -z clonescanner 2 }
inc %clones
}
inc %o
}
if (%type == -a) { echo -a * Done. $iif(%clones > 0,%clones,no) group $+ $iif(%clones > 1,s) of clones found. (done: $+ $calc($ticks - %ticks) $+ ms) | echo -a - }
else { did -ra clonescanner 4 Done. $iif(%clones > 0,%clones,no) group $+ $iif(%clones > 1,s) of clones found. (done: $+ $calc($ticks - %ticks) $+ ms) }
hfree cs
}
}
raw 352:*:if ($istok(%cs.chan,$2,32)) { halt }
raw 315:*:if ($istok(%cs.chan,$2,32)) { set %cs.chan $remtok(%cs.chan,$2,1,32) | clonescan $2 %cs.type | unset %cs.type | halt }
dialog clonescanner {
title "VTEC §cript GOLD ® Clone Scanner"
size -1 -1 200 100
icon $scriptdiricons\nlc.ico
option dbu
button "", 1, 0 0 0 0, ok
list 2, 2 2 185 93
box "", 3, 2 87 185 12
text "", 4, 5 91 182 7
icon 5, 171 2 45 96,$mircdir/pictures/K-TEK V-TEC Menubar.jpg
}