SHARE
TWEET

Untitled

a guest Jun 3rd, 2017 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias remote.stats {
  2.   unset %event.*
  3.   var %lines
  4.   var %k = 1
  5.   var %events
  6.   var %size
  7.   while (%k <= $script(0)) {
  8.     var %file = $script(%k)
  9.     var %s = $lines(%file)
  10.     var %i = 1
  11.     inc %size $file(%file).size
  12.     if ($nopath(%file) == remote.ini) { inc %k | continue }
  13.     inc %lines %s
  14.     while (%i <= %s) {
  15.       var %line = $read(%file,n,%i)
  16.       if ($gettok(%file,-1,46) == ini && $regex(%line,/^n\d+=/s)) {
  17.         var %line = $gettok(%line,2-,$asc(=))
  18.       }
  19.       if ($regex(%line,/^[\s]*on\s([^:]+):([^:]+):/i)) {
  20.         if (!$istok(%events,$regml(2),32)) {
  21.           var $+(%,event.,$regml(2))
  22.           var %events = $addtok(%events,$regml(2),32)
  23.         }
  24.         inc $+(%,event.,$regml(2)) 1
  25.       }
  26.       elseif ($regex(%line,/^alias\s([^\s]+)\s/i)) {
  27.         if (!$istok(%events,alias,32)) {
  28.           var $+(%,event.,alias)
  29.           var %events = $addtok(%events,alias,32)
  30.         }
  31.         inc $+(%,event.,alias) 1
  32.       }
  33.       :error
  34.       .reseterror
  35.       inc %i
  36.     }
  37.     inc %k
  38.   }
  39.   var %j = 1
  40.   var %str
  41.   while ($gettok(%events,%j,32)) {
  42.     var %c = $ifmatch
  43.     var %str = %str [[ $($+(%,event.,%c),2) %c ]]
  44.     inc %j
  45.   }
  46.   $iif($isid,return,msg $chan) Remote stats: Files [[ $script(0) ]] Total Lines: [[ %lines ]] Total Size: $bytes(%size).suf
  47.   $iif($isid,return,msg $chan) Events: ( %str )
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. ================
  56.  
  57. trigger: /remote.stats
  58.  
  59. ========================
  60.  
  61. ALIAS -l PowerScript {
  62.   set %Networks $scon(0)
  63.   set %Total.O 0
  64.   set %Total.H 0
  65.   set %Total.V 0
  66.   set %Total.R 0
  67.   set %power.Under 0
  68.   set %Power.Over 0
  69.   set %Power.Total 0
  70.   set %Power.Equal 0
  71.   set %Total.C 0
  72.   while (%Networks > 0 ) {
  73.     scon %Networks
  74.     inc %Total.C $chan(0)
  75.     set %Chan $chan(0)
  76.     while (%Chan > 0 ) {
  77.       inc %Power.Total $nick($chan(%Chan),0)
  78.       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) }
  79.       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) }
  80.       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) }
  81.       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) }
  82.       dec %Chan
  83.     }
  84.     dec %Networks
  85.   }
  86. }
  87. ALIAS Stats {    
  88.   /PowerScript
  89.   if ($scon(0) >= 2) {
  90.     /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.  
  91.     unset %Networks
  92.     unset %Total.O
  93.     unset %Total.H
  94.     unset %Total.V
  95.     unset %Total.R
  96.     unset %Power.Over
  97.     unset %Power.Total
  98.     unset %Power.Equal
  99.     unset %Power.Under
  100.     unset %Total.C
  101.     unset %Chan
  102.   }
  103.   Else {
  104.     /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.  
  105.     unset %Networks
  106.     unset %Total.O
  107.     unset %Total.H
  108.     unset %Total.V
  109.     unset %Total.R
  110.     unset %Power.Over
  111.     unset %Power.Total
  112.     unset %Power.Equal
  113.     unset %Power.Under
  114.     unset %Total.C
  115.     unset %Chan
  116.   }
  117. }
  118.  
  119.  
  120. =================
  121.  
  122. trigger: /stats
  123.  
  124. ===============
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top