All pastes #794372 Raw Edit

Unnamed

public text v1 · immutable
#794372 ·published 2007-11-23 02:00 UTC
rendered paste body
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 
  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 { say I'm opped in $tags($+(%oc,/,%tc)) channels. Hopped in $tags($+(%oh,/,%tc)) channels. Voiced in $iif(%vh > 0,$sbr($+(%vh,/,%tc)),$sbr($+(0,/,%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 } 
} 
tags { 
  var %s = $replace(%tags.format,<text>, $+ $1-) 
  if ($xchan($active)) { return $strip(%s) } 
  else { return %s } 
} 
xchan { if (c isincs $gettok($chan($1).mode,1,32)) { return 1 } }