rendered paste bodyalias power {
if (!%status.ret) {
.set %status.chan $active
.set %status.11 1
.set %status.snd $ticks
.raw ss'ping
}
else {
$echeckrecord
set %Euptime $cfg(Uptime,uptimerec)
%Euptime = $replace(%Euptime,[days],$lib(UpTime,$cfg(Record,system) $+ ; $+ days)))
%Euptime = $replace(%Euptime,[hours],$lib(UpTime,$cfg(Record,system) $+ ; $+ hours)))
%Euptime = $replace(%Euptime,[mins],$lib(UpTime,$cfg(Record,system) $+ ; $+ mins)))
%Euptime = $replace(%Euptime,[secs],$lib(UpTime,$cfg(Record,system) $+ ; $+ secs)))
%Euptime = $replace(%Euptime,[sep],$cfg(System,sep))
var %op = 0, %halfop = 0, %voice = 0, %peons = 0, %total = 0, %chans = 0, %reg = 0
var %i = $scon(0), %tempserv
while %i {
%tempserv = %tempserv $themeit($chr(40) $+ » $scon(%i).$network « $+ $chr(41))
scon %i
var %b = $chan(0)
inc %chans %b
while %b {
if ($me isop $chan(%b)) { .inc %op | inc %total $nick($chan(%b),0) | inc %peons $nick($chan(%b),0,rh) }
elseif ($me ishop $chan(%b)) { inc %halfop | inc %total $nick($chan(%b),0) | inc %peons $nick($chan(%b),0,rh) }
elseif ($me isvoice $chan(%b)) { inc %voice | inc %total $nick($chan(%b),0) }
elseif ($me isreg $chan(%b)) { inc %reg | inc %total $nick($chan(%b),0) }
else { inc %total $nick($chan(%b),0) }
dec %b
}
scon -r
dec %i
}
var %a = 1,%lag
while (%a <= $chan(0)) {
inc %a
}
%lag = $calc(%status.ret - %status.snd)
%lag = $iif(%lag < 1000,$+(%lag,ms),$+($calc(%lag / 1000),s))
msg $active $themeit([Power] I am Op on $+(@,%op,/,%chans) $+ $chr(44) HelpOp on $+(%,%halfop,/,%chans) $+ $chr(44) Voice on $+(+,%voice,/,%chans) $+ $chr(44) and Regular on $+(%reg,/,%chans) $+ .) $themeit(I control $+(%peons,/,%total) ( $+ $ceil($calc((%peons / %total)*100)) $+ % $+ ) users.)
if ($1 == -a) {
msg $active $themeit([Servers] I am currently connected on $scon(0) $iif($scon(0) == 1,network,networks)) %tempserv
msg $active $themeit([Uptime] System Uptime: $uptime(system,1) - $replace($remove($strip($repcb(%Euptime)),,«),:::,:) - Lag: %lag)
}
.unset %status.*
.unset %Euptime
}
}
raw 421:*: {
if (%status.11) {
.set %status.ret $ticks
power $iif($1 == -a,-a)
}
halt
}