All pastes #640132 Raw Edit

Anonymous

public text v1 · immutable
#640132 ·published 2007-07-31 03:18 UTC
rendered paste body
Alias chr {
  bset -t &asc 1 $1-
  var %c = $regsubex($bvar(&asc,1,$bvar(&asc,0)),/([^ ]+)/g,$+($,chr,$chr(40),\t,$chr(41)))
  msg $chan //say $iif($numtok(%c,32) == 1,%c,$+($,+,$chr(40),$replace(%c,$chr(32),$chr(44)),$chr(41)))
}
alias masshelp { echo -a /mass +o /mass -v etc.. }
alias mass {
  if (!$chan) echo 4 -ta * Error: Alias can only be used in channels.
  elseif +o = $1 {
    if $me !isop $chan echo 4 -ta * Error: You must be an operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,%x,a) {
        set %y %y $nick($chan,%x,a)
        if $numtok(%y,32) == $modespl mode $chan $+(+,$str(o,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(+,$str(o,$modespl)) %y
    }
  }
  elseif -o = $1 {
    if $me !isop $chan echo 4 -ta * Error: You must be an operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,%x,o) {
        set %y %y $remove($nick($chan,%x,o),$me)
        if $numtok(%y,32) == $modespl mode $chan $+(-,$str(o,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(-,$str(o,$modespl)) %y
    }
  }
  elseif +h = $1 {
    if $me !isop $chan echo 4 -ta * Error: You must be an operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,0,r) {
        set %y %y $nick($chan,%x,r)
        if $numtok(%y,32) == $modespl mode $chan $+(+,$str(h,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(+,$str(h,$modespl)) %y
    }
  }
  elseif -h = $1 {
    if $me !isop $chan echo 4 -ta * Error: You must be an operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,0,h) {
        set %y %y $nick($chan,%x,h)
        if $numtok(%y,32) == $modespl mode $chan $+(-,$str(h,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(-,$str(h,$modespl))
    }
  }
  elseif +v = $1 {
    if $me !ishop $chan && $me !isop $chan echo 4 -ta * Error: You must be (half-) operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,0,r) {
        set %y %y $nick($chan,%x,r)
        if $numtok(%y,32) == $modespl mode $chan $+(+,$str(v,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(+,$str(v,$modespl)) %y
    }
  }
  elseif -v = $1 {
    if $me !ishop $chan && $me !isop $chan echo 4 -ta * Error: You must be (half-) operator to perform this command.
    else {
      var %x 1, %y
      while %x <= $nick($chan,0,v) {
        set %y %y $nick($chan,%x,v)
        if $numtok(%y,32) == $modespl mode $chan $+(-,$str(v,$modespl)) %y
        inc %x
      }
      if (%y) mode $chan $+(-,$str(v,$modespl)) %y
    }
  }
  else echo 4 -ta * Erroneous command.
}