All pastes #753928 Raw Edit

Someone

public text v1 · immutable
#753928 ·published 2007-10-29 17:28 UTC
rendered paste body
;----------------------- Start colour aliases ------------------------
;----- Only put these in your script if you haven't already got them in ANY file!
;----- If you aren't sure if you have it already, type
;----- //echo -t $c1(test) $c2(test)
;----- If you see two times test, the aliases already exist. If you don't see it, put the two lines below in the script
alias c1 { return $+($chr(3),14,$1-,$chr(3)) }
alias c2 { return $+($chr(2),$chr(3),04,$1-,$chr(3),$chr(2)) }
;------------------------ End colour aliases -------------------------

;---------------------------- Start script ---------------------------
alias power {
  var %x = 1
  var %o = 0
  var %h = 0
  var %v = 0
  var %c = 0
  var %t = 0
  while (%x <= $chan(0)) {
    if ($me isop $chan(%x)) {
      inc %o
      inc %t $nick($chan(%x),0)
      inc %c $nick($chan(%x),0)
      inc %x
    }
    elseif ($me ishop $chan(%x)) {
      inc %h
      inc %t $nick($chan(%x),0)
      inc %c $calc($nick($chan(%x),0) - $nick($chan(%x),0,o))
      inc %x
    }
    elseif ($me isvoice $chan(%x)) {
      inc %v
      inc %t $nick($chan(%x),0)
      inc %x
    }
    elseif ($me isreg $chan(%x)) {
      inc %t $nick($chan(%x),0) 
      inc %x
    }
  }
  say $c1(I'm on) $c2($chan(0)) $c1(channels $+ $chr(44) opped on) $c2(%o) $+ $c1(, halfopped on) $c2(%h) $c1(and voiced on) $c2(%v) $+ $c1(. I can control) $c2(%c) $+ $c1(/) $+ $c2(%t) $c1(or $chr(40)) $+ $c2($round($calc(%c * 100 / %t),2)) $+ $c1(%) $+ $c1($chr(41) of the people.) $checkircop
}

alias checkircop {
  if ($regex($usermode,/o/)) {
    if ($regex($usermode,/N/)) { return $c1(I'm also) $c2(Network Administrator) $c1(on this network.) }
    elseif ($regex($usermode,/C/)) { return $c1(I'm also) $c2(Co Administrator) $c1(on this network.) }
    elseif ($regex($usermode,/a/)) { return $c1(I'm also) $c2(Services Administrator) $c1(on this network.) }
    elseif ($regex($usermode,/A/)) { return $c1(I'm also) $c2(Server Administrator) $c1(on this network.) }
    else { return $c1(I'm also) $c2(Global IRCOperator) $c1(on this network.) }
  }
  elseif ($regex($usermode,/O/)) { return $c1(I'm also) $c2(Local IRCOperator) $c1(on this network.) }
}
;--------------------------------- End script --------------------------------