All pastes #490102 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-15 21:06 UTC
rendered paste body
on *:join:#team7:{
  var %x = 1
  var %total = $lines(users.txt)
  while (%x <= %total) {
    if ($nick isin $read(users.txt,%x)) { /mode #team7 +o $nick }
    inc %x
  }
}
on *:op:#team7:{
  var %x = 1
  var %total = $lines(users.txt)
  while (%x <= %total) {
    if ($opnick isin $read(users.txt,%x)) { set %op.nick true }
    inc %x
  }
  set %nick.op $opnick
  verificar-op
}
alias verificar-op {
  if (%op.nick != true) { /mode #team7 -o %nick.op | set %op.nick false | halt }
  else { set %op.nick false | halt }
}
on *:text:!up:#team7:{
  var %x = 1
  var %total = $lines(users.txt)
  while (%x <= %total) {
    if ($nick isin $read(users.txt,%x)) { /mode #team7 +o $nick }
    inc %x
  }
}
on *:text:!op*:#team7:{
  var %x = 1
  var %total = $lines(users.txt)
  while (%x <= %total) {
    if ($2 isin $read(users.txt,%x)) { /mode #team7 +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
  var %total = $lines(users.txt)
  while (%x <= %total) {
    if ($2 isin $read(users.txt,%x)) {
      /mode #team7 -o $2 
      write -d%x users.txt
      notice $nick $2 removido da lista de OP's.
    }
    inc %x

  }
}