•[C]a§§IoPe[A] [S]cRiP[t]•

;-------- -  -
; Raws
;-------- -  -
raw 352:*:if (%_clone.who == 1) { haltdef }
raw 315:*:{ if (%_clone.who == 1) { unset %_clone.who | clscan | halt } }
;-------- -  -
; Aliases
;-------- -  -
alias _cloneprot { return $readini cloneprot.ini Options $1 }
alias _wrclone { writeini cloneprot.ini Options $1- }
alias clonescan { set %cscan.time $ctime | dialog -m c c  | if ($me !isop $iif($2,$2,$chan)) { did -b c 8,9 } | did -a c 5 Scanned: $1 | pbar clones Scanning for clones on $iif($2,$2,$chan) | pdraw clones 0 Getting user information, please wait... | set %_clone.chan $iif($2,$2,$chan) | set %_clonechan $iif($2,$2,$chan) | if ($chan($1).ial == $true) { dialog -t c Scanning for clones...  | clscan } | else { .ial on | set %_clone.who 1 | .who $1 } }
alias -l scan { pdraw clones $round($calc($1 / $2 * 100),0) $1 / $2 }
alias -l clone { did -ra c 6 Clones: $1 / $nick(%_clone.chan,0) }
alias -l clscan { var %num = $nick(%_clone.chan,0) | var %i = $calc(%num + 1), %addr, %j, %tmp, %k = 0, %q = 0 | :next | dec %i | scan $calc(%num - %i) %num %k | if ($ialchan($address($nick(%_clone.chan,%i),2),%_clone.chan,0) > 1 && $istok(%addr,$address($nick(%_clone.chan,%i),2),169) == $false) { inc %q | %addr = $addtok(%addr,$address($nick(%_clone.chan,%i),2),169) | %tmp =  $+ $colr(addr) | %j = $calc($ialchan($address($nick(%_clone.chan,%i),2),%_clone.chan,0) + 1)
    :next2 | inc %k | dec %j | %tmp = %tmp $+ $gettok($ialchan($address($nick(%_clone.chan,%i),2),%_clone.chan,%j),1,33) $+ ,  | if ($calc(%q % 2) == 0) { did -a c 4 $gettok($ialchan($address($nick(%_clone.chan,%i),2),%_clone.chan,%j),1,33)) | did -a c 7 $address($nick(%_clone.chan,%i),2) } | else { did -a c 4 $gettok($ialchan($address($nick(%_clone.chan,%i),2),%_clone.chan,%j),1,33))  | did -a c 7 $address($nick(%_clone.chan,%i),2) } | if (%j != 1) goto next2 
  clone %k $calc(%num - %i) } | if (%i != 0) goto next | unset %_clone.chan | scan %num %num %k | if (%k == 0) { did -a c 4 No clones found. } | did -a c 5 Scanned %_clonechan in $duration($calc($ctime - %cscan.time)) | pdraw clone 100 Scan finished. 
}
alias pbar { var %tmp @Pbar. $+ $1 | if $window(%tmp) == $null { window -dahkop +esLf %tmp $int($calc(($window(-1).w - 300) / 2)) $int($calc(($window(-1).h - 100) / 2)) 300 100 | drawrect -frn %tmp $rgb(face) 7 0 0 300 100 | if ($2 != $null) drawtext -nr %tmp $rgb(text) "ms sans serif" 20 $calc(150 - $width($2-,ms sans serif,20,1,0) / 2) 5 $2- | drawdot %tmp } | else { drawrect -frn %tmp $rgb(face) 7 0 0 300 30 | drawtext -nr %tmp $rgb(text) "ms sans serif" 20 $calc(150 - $width($2-,ms sans serif,20,1,0) / 2) 5 $2- } }
alias pdraw { var %tmp @Pbar. $+ $1 | if (($window(%tmp) == $null) || ($2 > 100) || ($2 < 0)) halt | drawrect -frn %tmp $rgb(face) 7 9 30 282 50 | drawtext -nro %tmp $rgb(text) "verdana" 14 $calc((135 - $width($int($2) $+ %,verdana,14,1,0) / 2) + 9) 50 $int($2) $+ % | drawrect -nif %tmp 1 0 9 50 $int($calc($2 * 2.7)) 15 | if ($3 != $null) drawtext -nr @Pbar. $+ $1 $rgb(text) "ms sans serif" 12 $calc(150 - $width($3-,ms sans serif,12,1,0) / 2) 30 $3- | drawdot %tmp | if ($2 == 100) .timer 1 1 window -c %tmp }

;-------- -  -
; Menu's
;-------- -  -
menu @Pbar.* { 
  dclick:window -c $active 
}
;-------- -  -
; Dialogs
;-------- -  -
dialog c {
  option pixel
  size -1 -1 500 300
  title "Scan Cloni •NonSoloIRC.Net Script•"
  tab "Risultato della scansione" 2, 10 10 480 253
  box "" 3, 20 40 460 208
  text "Scansionati" 5, 27 53 300 13
  text "Responso: none" 6, 27 70 300 13
  list  4,  27 90 100 120,
  list  7, 130 90 342 120,
  button "Kick" 8, 28 210 50 25
  button "KickBan" 9, 85 210 50 25 
  button "Ok" 1, 225 269 50 25, ok
}
;-------- -  -
; Events
;-------- -  -
on !*:JOIN:#: { if ($ialchan($wildsite,#,0) > 1) { set %clone.scan.total $ialchan($wildsite,#,0) | set %clone.scan.current 0 
    if ($_cloneprot(Join_Scan)) {
      if (%clone.scan.total > $_cloneprot(more_than)) { 
        if ($gettok($_cloneprot(kick_only),1,32)) { kick $chan $nick $gettok($_cloneprot(kick_only),2-,32) } 
        if ($_cloneprot(ban_only) == $true) { mode $chan +b $wildsite } 
        if ($gettok($_cloneprot(kick_ban),1,32) == $true) { mode $chan +b $wildsite | kick $chan $nick $gettok($_cloneprot(kick_ban),2-,32) } 
        ;if ($_cloneprot(warn) == msg) { msg $nick Please do not clone in $Chan }
        ;if ($_cloneprot(warn) == notice) { notice $nick Please do not clone in $chan }
        if ($_cloneprot(warn) == $false) { return }
    } }
    if (%clone.scan.total > 10) { echo $chan $chr(3) $+ 04*** Clone Scan: Too many clones to kick, may risk being flooded off. A ban will still be placed. } 
    :start | inc %clone.scan.current 1 | set %clone.scan.list %clone.scan.list $+ $chr(32) $+ $ialchan($wildsite,#,%clone.scan.current).nick $+ , | if ($ialchan($wildsite,#,%clone.scan.current).nick !isin %clone.kick. [ $+ [ $chan ] ]) { set -u10 %clone.kick. [ $+ [ $chan ] ] %clone.kick. [ $+ [ $chan ] ] $+ $ialchan($wildsite,#,%clone.scan.current).nick $+ , } 
    if (%clone.scan.current < %clone.scan.total) { goto start } 
    if ($_cloneprot(Echo_active)) { if ($active != $chan) { echo -a $chan 3*** Clones Detected from $site $+ : $left(%clone.scan.list,-1) } }
    if ($_cloneprot(Echo_channel)) { echo $chan $timestamp 9Rilevato Clone 3==> $site $+ :9 $left(%clone.scan.list,-1) }
    if ($gettok($_cloneprot(Echo_window),1,32)) { window $gettok($_cloneprot(Echo_window),2,32) | aline $gettok($_cloneprot(Echo_window),2,32) $chan 3*** Clones Detected from $site $+ : $left(%clone.scan.list,-1) }
    unset %clone.scan.list 
  } 
} 
