What im trying to do here is when i click the check button it will scan all nicks in all open chans for a word in a tx file. Im not so sure the best way to do this but the way i have it now i am getting an error "* /while: invalid format (line 38, namecheck.mrc)" and that line is /nickscanfile. Any help would be great. Thanks
Code:
menu channel,menubar,status,@Check {
  &Name Check: { dialog -rm namecheck namecheck }
}

dialog namecheck {
  title "Nick Check"
  size -1 -1 207 131
  option dbu
  combo 1, 5 7 58 103, size edit
  button "Check", 2, 66 20 28 9
  list 3, 99 19 99 89, sort extsel hsbar
  button "Kick/Ban", 4, 66 33 28 9
  button "Kick", 5, 66 45 29 9
  button "Ban", 6, 66 57 29 9
  button "OK", 7, 161 114 37 12, ok
}
on *:dialog:namecheck:*:*: {
  if ($did == 2) {
    if ($devent == sclick) {
      var %i = 1
      while (%i <= $chan(0)) {
        scannick $chan(%i)
        //echo -a $chan(%i)
        inc %i
      }
    }
  }
}
alias scannick {
  var %s = 1
  while (%s <= $nick($1,0)) {
    /nickscanfile $nick($1,%s)
    inc %s
  }
}
alias nickscanfile {
  var %f = 1
  while (%f <= $lines(nickcheck.txt) {
    if ($read(nickcheck.txt, %f) iswn $1) //echo -a $1
    inc %f
  }
}