All pastes #490208 Raw Edit

Something

public text v1 · immutable
·published 2007-05-15 22:02 UTC
rendered paste body
alias verifOP {
  var %x = 1, %total = $nick($1,0,r)
  while (%x <= %total) {
    var %nick = $nick($1, %x, r)
    if ($read(users.txt, w, * $+ %nick $+ *)) {
      mode $1 +o %nick
    }
    inc %x
  }
}

on *:join:#team7:{
  if ($nick != $me) {
    var %x = 1, %total = $lines(users.txt)
    while (%x <= %total) {
      if ($nick == $read(users.txt,%x)) { mode # +o $nick }
      inc %x
    }
  }
  if ($nick == $me) {
    echo -a ENTRASTE
    .timerVERIFOP 1 2 verifOP #
  }
}
on *:op:#team7:{
  var %x = 1, %total = $lines(users.txt)
  while (%x <= %total) {
    if ($opnick == $read(users.txt,%x)) { set %op.nick true }
    inc %x
  }
  set %nick.op $opnick
  verificar-op
}
alias verificar-op {
  if (%op.nick != true) { mode # -o %nick.op | set %op.nick false | halt }
  else { set %op.nick false | halt }
}
on *:text:!up:#team7:{
  var %x = 1, %total = $lines(users.txt)
  while (%x <= %total) {
    if ($nick == $read(users.txt,%x)) { mode # +o $nick }
    inc %x
  }
}
on *:text:!op*:#team7:{
  var %x = 1, %total = $lines(users.txt)
  while (%x <= %total) {
    if ($2 == $read(users.txt,%x)) { mode # +o $2 }
    inc %x
  }
}
on 1000:text:+add*:#team7:{
  write users.txt $2
  notice $nick $2 adicionado á lista de OP's.
}

on 1000:text:+rem*:#team7:{
  var %x = 1, %total = $lines(users.txt)
  while (%x <= %total) {
    if ($2 isin $read(users.txt,%x)) {
      mode # -o $2 
      write -d $+ %x users.txt
      notice $nick $2 removido da lista de OP's.
    }
    inc %x

  }
}