All pastes #927505 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-04 10:35 UTC
rendered paste body
alias opover {
  var %i = 1
  var %me = 0, %them = 0
  var %ii = 1
  var %x = 0
  while (%i <= $comchan($1,0)) {
    set %ii 1
    while (%ii <= $nick($comchan($1,%i),0,q)) {
      if ($nick($comchan($1,%i),%ii,q) == $1) {
        set %them 4
      }
      elseif ($nick($comchan($1,%i),%ii,q) == $me) {
        set %me 4
      }
      inc %ii
    }
    set %ii 1
    while (%ii <= $nick($comchan($1,%i),0,a)) {
      if (($nick($comchan($1,%i),%ii,q) == $1) && (!%them)) {
        set %them 3
      }
      elseif (($nick($comchan($1,%i),%ii,q) == $me) && (!%me)) {
        set %me 3
      }
      inc %ii
    }
    if ($me isop $comchan($1,%i)) && (!%me) {
      set %me 2
    }
    elseif ($1 isop $comchan($1,%i)) && (!%them) {
      set %them 2
    }
    if ($me ishop $comchan($1,%i)) && (!%me) {
      set %me 1
    }
    elseif ($1 ishop $comchan($1,%i)) && (!%them) {
      set %them 1
    }
    ;echo -a $comchan($1,%i): me: %me them: %them
    if (%me >= 2) && (%me >= %them) { inc %x }
    elseif (%me == 1) && (%me > them) { inc %x }
    inc %i
    set %me 0 | set %them 0
  }
  ;echo -a I could kick $1 from %x channels.
  msg $active I could kick $1 from %x channels.
}