Try this:
Code:
On *:OP:#channel:{
  var %i = 1
  while (%i <= $lines(op.txt)) {
    if ($opnick !isin $read(op.txt,%i)) { inc %i }
    else { return }
  }
  write op.txt $opnick
}


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke