Your problem was you had both the
INC %n's inside the IF condition
if ($read($mircdirgxfiles/highlight.txt,%n) isin %matchtxt) thus is that condition was false, then %n was not increased, and you looped around and checked the same line again, again producing a false condition, akak endless loop.
This code should work... NB: i used a
BREAK command to exit the while loop, rather than a goto, this is the preferred method of imediatly exiting a loop.
alias highlight {
var %n = 1
while (%n <= $lines($mircdirfiles/highlight.txt)) {
if ($read($mircdirgxfiles/highlight.txt,%n) isin %matchtxt) {
if (%hwinow == on) {
window - $+ %winstil @Highlight 200 200 600 200 fixedsys
settime1
check.hlsound
echo @Highlight %_tstmp $chr(3) $+ $color(highlight) $+ $chr(2) $+ Highlight $+ $chr(3) $+ $chr(2) in %matchchan > %matchnick saying $+ $chr(58) %matchtxt
BREAK
}
else {
settime1
check.hlsound
echo %_tstmp $chr(3) $+ $color(highlight) $+ $chr(2) $+ Highlight $+ $chr(3) $+ $chr(2) in %matchchan > %matchnick saying $+ $chr(58) %matchtxt
}
}
inc %n
}
}