All pastes #417532 Raw Edit

Miscellany

public text v1 · immutable
#417532 ·published 2007-03-30 22:45 UTC
rendered paste body
alias chans { 
  var %op = 0, %halfop = 0, %voice = 0, %peons = 0, %total = 0, %chans = 0 
  var %a = 1 
  while (%a <= $scon(0)) { 
    .scon %a 
    var %b = 1 
    inc %chans $chan(0) 
    while (%b <= $chan(0)) { 
      if ($me isop $chan(%b)) { .inc %op | inc %total $nick($chan(%b),0) | inc %peons $calc($nick($chan(%b),0) - $nick($chan(%b),0,o)) | inc %b } 
      elseif ($me ishop $chan(%b)) { inc %halfop | inc %total $nick($chan(%b),0) | inc %peons $calc($nick($chan(%b),0) - ($nick($chan(%b),0,o) + $nick($chan(%b),0,h))) | inc %b } 
      elseif ($me isvoice $chan(%b)) { inc %voice | inc %total $nick($chan(%b),0) | inc %b } 
      else { inc %total $nick($chan(%b),0) | inc %b } 
    } 
    inc %a 
  } 
  .scon -r 
  msg $active 12[14 My Satus: Op in12 %op $+ 14, Halfop in12 %halfop $+ 14, and Voice in12 %voice 14out of12 %chans 14channels over12 $scon(0) 14networks. I have power over12 $+(%peons,/,%total) 14users. 12] 
}