Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias remote.stats {
- unset %event.*
- var %lines
- var %k = 1
- var %events
- var %size
- while (%k <= $script(0)) {
- var %file = $script(%k)
- var %s = $lines(%file)
- var %i = 1
- inc %size $file(%file).size
- if ($nopath(%file) == remote.ini) { inc %k | continue }
- inc %lines %s
- while (%i <= %s) {
- var %line = $read(%file,n,%i)
- if ($gettok(%file,-1,46) == ini && $regex(%line,/^n\d+=/s)) {
- var %line = $gettok(%line,2-,$asc(=))
- }
- if ($regex(%line,/^[\s]*on\s([^:]+):([^:]+):/i)) {
- if (!$istok(%events,$regml(2),32)) {
- var $+(%,event.,$regml(2))
- var %events = $addtok(%events,$regml(2),32)
- }
- inc $+(%,event.,$regml(2)) 1
- }
- elseif ($regex(%line,/^alias\s([^\s]+)\s/i)) {
- if (!$istok(%events,alias,32)) {
- var $+(%,event.,alias)
- var %events = $addtok(%events,alias,32)
- }
- inc $+(%,event.,alias) 1
- }
- :error
- .reseterror
- inc %i
- }
- inc %k
- }
- var %j = 1
- var %str
- while ($gettok(%events,%j,32)) {
- var %c = $ifmatch
- var %str = %str [[ $($+(%,event.,%c),2) %c ]]
- inc %j
- }
- $iif($isid,return,msg $chan) Remote stats: Files [[ $script(0) ]] Total Lines: [[ %lines ]] Total Size: $bytes(%size).suf
- $iif($isid,return,msg $chan) Events: ( %str )
- }
- ================
- trigger: /remote.stats
- ========================
- 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.Under 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.Over $nick($chan(%Chan),0,o) }
- elseif ( $me ishop $chan(%Chan) ) { inc %Total.H | inc %Power.Under $nick($chan(%Chan),0,a,oh) | inc %Power.Under $nick($chan(%Chan),0,h,o) | inc %Power.Under $nick($chan(%Chan),2,o) }
- elseif ( $me isvoice $chan(%Chan) ) { inc %Total.V | inc %Power.Under $nick($chan(%Chan),0,r) | inc %Power.Under $nick($chan(%Chan),0,v,ho) | inc %Power.Under $nick($chan(%Chan),0,oh) }
- elseif ( $me isreg $chan(%Chan) ) { inc %Total.R | inc %Power.Under $nick($chan(%Chan),0,r,ohv) | inc %Power.Under $nick($chan(%Chan),0,a,r) }
- dec %Chan
- }
- dec %Networks
- }
- }
- ALIAS Stats {
- /PowerScript
- if ($scon(0) >= 2) {
- /msg $active 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. I have power over ( $+ 04 $+ %Power.Over $+ 14/12 $+ %Power.Total $+ 14) people.
- 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
- }
- Else {
- /msg $active 14I am on12 %Total.C 14channels;12 $scon(0) 14network. 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 Regulars14. I have power over ( $+ 04 $+ %Power.Over $+ 14/12 $+ %Power.Total $+ 14) people.
- 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
- }
- }
- =================
- trigger: /stats
- ===============
Add Comment
Please, Sign In to add comment