The script I have been working on, reads a .txt file with about 500 lines in it (quotes). I have the random read working, I also have it so you can specify what line you want it to read. But i cant seem to get the -w switch to work the way i want it to

Code:
 
on *:text:.find quote *:#:{
  set %quote $read(C:\bot\bot_log_pub.txt, w, * $+ $3 $+ *, $calc($readn + 1) )
  /msg # %quote
  /ignore -u5 $nick
}
 


for eg: .find quote dak
would return the first line that has *dak* in it, then the next time you use the .find quote * , it will start from the line it just read + 1. this is fine, untill it gets to the last line in the .txt file.
at that point, i cant seem to find a way to reset $readn back to 1 after it has hit the end of the document.


______________________________

123go