All pastes #185514 Raw Edit

Unnamed

public text v1 · immutable
#185514 ·published 2006-09-29 01:00 UTC
rendered paste body
alias power {
  var %tc = 0,%tu = 0,%oc = 0,%po = 0,%i = $scid(0)
  while (%i) {
    scid $scon(%i)
    if ($status == connected) {
      var %c = $chan(0)
      while (%c) {
        inc %tc
        inc %tu $calc($nick($chan(%c),0) -1)
        if ($me isop $chan(%c)) {
          inc %oc
          inc %po $calc($nick($chan(%c),0) -1)
        }
        dec %c
      }
    }
    dec %i
  }
  scid -r
  if (!$isid) {
    if ($1 == -e) { echo -a $gtd(Stats) you're opped in $sd($+(%oc,/,%tc)) channels on $sd($scid(0)) $iif($scid(0) == 1,network.,networks.) You have the power over $sd($+(%po,/,%tu)) users. }
    else { say I'm opped in $+(10[,%oc,/,%tc,10])$+ channels on $+(10[,$scid(0),10]) $iif($scid(0) == 1,network.,networks.) I have the power over $+(10[,%po,/,%tu,10])$+ users. }
  }
  else { return %po }
}