rendered paste bodyALIAS Power {
/PowerScript
/msg $chan I am on12 %Total.C channels; 12 $scon(0) networks. I have:4 %Total.O 14(4 $+ $round($calc( %Total.O / %Total.C * 100 ),0) $+ 14%)4 Ops,7 %Total.H 14(7 $+ $round($calc( %Total.H / %Total.C * 100 ),0) $+ 14%)7 Half-Ops,2 %Total.V 14(2 $+ $round($calc( %Total.V / %Total.C * 100 ),0) $+ 14%)2 Voices,10 %Total.R 14(10 $+ $round($calc( %Total.R / %Total.C * 100 ),0) $+ 14%)10 Regulars.
/msg $chan I have power over12 %Power.Over $+ 15/12 $+ %Power.Total 14(12 $+ $round($calc( %Power.Over / %Power.Total * 100 ),2) $+ 14%14) users. Equal power with12 %Power.Equal $+ 15/12 $+ %Power.Total 14(12 $+ $round($calc( %Power.Equal / %Power.Total * 100 ),2) $+ 14%) users. Power under12 %Power.Under $+ 15/12 $+ %Power.Total 14(12 $+ $round($calc( %Power.Under / %Power.Total * 100 ),2) $+ 14%) users.
unset %Networks
unset %Total.O
unset %Total.H
unset %Total.V
unset %Total.R
unset %Power.Over
unset %Power.Total
unset %Power.Equal
unset %Power.Under
unset %Total.C
unset %Chan
}
ALIAS -l PowerScript {
set %Networks $scon(0)
set %Total.O 0
set %Total.H 0
set %Total.V 0
set %Total.R 0
set %Power.Over 0
set %Power.Total 0
set %Power.Equal 0
set %Total.C 0
while (%Networks > 0 ) {
scon %Networks
inc %Total.C $chan(0)
set %Chan $chan(0)
while (%Chan > 0 ) {
inc %Power.Total $nick($chan(%Chan),0)
if ( $me isop $chan(%Chan) ) { inc %Total.O | inc %Power.Over $nick($chan(%Chan),0,a,o) | inc %Power.Equal $nick($chan(%Chan),0,o) }
elseif ( $me ishop $chan(%Chan) ) { inc %Total.H | inc %Power.Over $nick($chan(%Chan),0,a,oh) | inc %Power.Equal $nick($chan(%Chan),0,h,o) | inc %Power.Under $nick($chan(%Chan),0,o) }
elseif ( $me isvoice $chan(%Chan) ) { inc %Total.V | inc %Power.Over $nick($chan(%Chan),0,r) | inc %Power.Equal $nick($chan(%Chan),0,v,ho) | inc %Power.Under $nick($chan(%Chan),0,oh) }
elseif ( $me isreg $chan(%Chan) ) { inc %Total.R | inc %Power.Equal $nick($chan(%Chan),0,r,ohv) | inc %Power.Under $nick($chan(%Chan),0,a,r) }
dec %Chan
}
dec %Networks
}
}