All pastes #508103 Raw Edit

Something

public text v1 · immutable
·published 2007-05-24 21:29 UTC
rendered paste body
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 ($ccontrol($chan(%c))) {
          inc %oc
          inc %po $calc($nick($chan(%c),0) -1)
        }
        dec %c
      }
    }
    dec %i
  }
  scid -r
  if (!$isid) {
    if ($1 == -e) { thmecho -a Stats: you're opped in $thmhl($+(%oc,/,%tc)) channels on $thmhl($scid(0)) $iif($scid(0) == 1,network.,networks.) You have the power over $thmhl($+(%po,/,%tu)) users. }
    else { say I'm opped in $sbr($+(%oc,/,%tc)) channels on $sbr($scid(0)) $iif($scid(0) == 1,network.,networks.) I have the power over $sbr($+(%po,/,%tu)) users. }
  }
  else { return %po }
}