Clone/IRCOp scanner
Posted by KilledInAction
Tuesday, March 16, 2004
Description: What the title says... scans the channel for clones or IRCOps
;Usage:
;/clonescan [channel]
;/ircopscan [channel]
;please note that the clonescan cannot see through hosthide
alias clonescan {
if ((%waitscan) || (%clonescan)) { echo -a Please wait for your previous scan to finish before starting a new scan. | return }
if ($left($1,1) == $chr(35)) set %scanchan $1
elseif ($chan) set %scanchan $chan
else { echo -a You must either use this command on a channel, or specify a channel. | return }
set %clonescan 1
if ($hget(clonescan)) hfree clonescan
hmake clonescan 30
.who %scanchan
}
alias ircopscan {
if ((%waitscan) || (%clonescan)) { echo -a Please wait for your previous scan to finish before starting a new scan. | return }
if ($left($1,1) == $chr(35)) set %scanchan $1
elseif ($chan) set %scanchan $chan
else { echo -a You must either use this command on a channel, or specify a channel. | return }
set %waitscan 1
if ($hget(ircopscan)) hfree ircopscan
hmake ircopscan 10
.who %scanchan
}
raw 352:*: {
if (%waitscan) {
if ($chr(42) isin $7) {
hadd ircopscan n $calc($hget(ircopscan,n) + 1)
hadd ircopscan $hget(ircopscan,n) $6
}
hadd ircopscan t $calc($hget(ircopscan,t) + 1)
haltdef
}
elseif (%clonescan) {
if ($numtok($hget(clonescan,$4),32) == 1) {
hadd clonescan n $calc($hget(clonescan,n) + 1)
hadd clonescan $hget(clonescan,n) $4
}
hadd clonescan $4 $addtok($hget(clonescan,$4),$6,32)
hadd clonescan t $calc($hget(clonescan,t) + 1)
haltdef
}
}
raw 315:*: {
if (%waitscan) {
linesep $active
echo -a || $+ $str(=,18) IRC Operators - Channel %scanchan $str(=,18) $+ ||
if (!$hget(ircopscan,n)) echo -a || No IRCOps present.
else {
var %curop = 1
while ($hget(ircopscan,%curop)) {
if ($calc($len(%sayop) + $len($hget(ircopscan,%curop)) + 3 - $len(%scanchan)) > 63) {
echo -a || %sayop $+ $chr(44)
unset %sayop
}
set %sayop %sayop $+ $iif(%sayop == $null,$hget(ircopscan,%curop),$chr(44) $hget(ircopscan,%curop))
inc %curop
}
echo -a || %sayop
echo -a || [^B] $+ $calc(%curop - 1) $+ [^B] IRCOps found out of [^B] $+ $hget(ircopscan,t) $+ [^B] total users. ([^B] $+ $round($calc((%curop - 1) * 100 / $hget(ircopscan,t)),2) $+ $chr(37) $+ [^B] IRCOps)
}
echo -a || $+ $str(=,16) End Of IRCOp Scan - Channel %scanchan $str(=,16) $+ ||
unset %waitscan | unset %sayop
haltdef
}
elseif (%clonescan) {
linesep $active
echo -a || $+ $str(=,19) Clone Scan - Channel %scanchan $str(=,20) $+ ||
if ($hget(clonescan,1) == $null) echo -a || No clones found.
else {
var %clones,%curclone,%curhost = 1
while ($hget(clonescan,%curhost)) {
%curclone = 1
while ($gettok($hget(clonescan,$hget(clonescan,%curhost)),%curclone,32)) {
echo -a || $hget(clonescan,%curhost) - $gettok($hget(clonescan,$hget(clonescan,%curhost)),%curclone,32)
inc %clones | inc %curclone
}
inc %curhost
}
echo -a || [^B] $+ %clones $+ [^B] clones found on [^B] $+ $calc(%curhost - 1) $+ [^B] cloned hosts.
echo -a || Total [^B] $+ $hget(clonescan,t) $+ [^B] users on %scanchan $+ . ([^B] $+ $round($calc(%clones * 100 / $hget(clonescan,t)),2) $+ $chr(37) $+ [^B] clones)
}
echo -a || $+ $str(=,17) End Clone Scan - Channel %scanchan $str(=,18) $+ ||
unset %clonescan
}
}