if the first word in the op.txt file on each line is a persons nickname then why not just do:

Code:
on *:OP:#:{
if (!$read(op.txt,s,$nick)) {
write op.txt $nick
}
}


otherwize, if the nicknames are on each line, but arent at the start, or are jumbled in with other text on the same line, like time and date of the op, along with the channel name or something, then you can do a wildcard search for the nick on the line:

Code:
on *:OP:#:{
if (!$read(op.txt,w,* $+ $nick $+ *)) {
write op.txt $nick with whatever other data you want
}
}


no need to use a loop at all, just think, what if your text file becomes quite large, then you have to loop through ALLL the lines in the file to make sure it isnt in there, slows down mirc alot more wink