All pastes #895745 Raw Edit

Mine

public text v1 · immutable
·published 2008-02-08 01:15 UTC
rendered paste body
alias power {
  var %tc = 0,%tu = 0,%oc = 0,%po = 0,%i = $scid(0),%vh = 0,%vo = 0,%oh = 0,%ph = 0,%reg = 0,%rego = 0,%tags.format = 04[<text>04] 
  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($chan(%c))) {
          inc %oc
          inc %po $calc($nick($chan(%c),0) -1)
        }
        elseif ($me ishop $chan($chan(%c))) {
          inc %oh
          inc %ph $calc($nick($chan(%c),0) -1)
        }
        elseif ($me isvoice $chan($chan(%c))) {
          inc %vh
          inc %vo $calc($nick($chan(%c),0) -1)
        }
        elseif ($me isreg $chan($chan(%c))) {
          inc %reg
          inc %rego $calc($nick($chan(%c),0) -1)
        }
        dec %c
      }
    }
    dec %i
  }
  scid -r
  if (!$isid) {
    if ($1 == -e) { echo -ta I'm opped in $tags($+(%oc,/,%tc)) channels. Hopped in $tags($+(%oh,/,%tc)) channels. Voiced in $tags($+(%voice,/,%tc)) channels. Reg in $tags($+(%reg,/,%tc)) channels. I am on $tags($scid(0)) $iif($scid(0) == 1,network.,networks.) I have the power over $tags($+(%po,/,%tu)) users. }
    else { msg $active I'm opped in $tags($+(%oc,/,%tc)) channels. Hopped in $tags($+(%oh,/,%tc)) channels. Voiced in $tags($+(%vh,/,%tc)) channels. Reg in $tags($+(%reg,/,%tc)) channels. I am on $tags($scid(0)) $iif($scid(0) == 1,network.,networks.) I have the power over $tags($+(%po,/,%tu)) users. }
  }
  else { return %po }
}
alias tags {
  var %s = $replace(%tags.format,<text>, $+ $1-)
  if ($xchan($active)) { return $strip(%s) }
  else { return %s }
}
alias xchan { if (c isincs $gettok($chan($1).mode,1,32)) { return 1 } }