Ok, I'm beginning to feel stupid today... this makes 2 scripts with stupid mistakes in them. That's what I get for trying to code snippets in the middle of writing a mIRC RPG. smile

This will work for you. I wasn't incrementing properly. I also didn't give the proper /play syntax.

Code:
on 1:!search *:#mychannel: {
  var %search = $2
  var %lines = $lines(database.txt)
  var %currentline = 1
  var %total = 0
  while (%currentline <= %lines) {
    var %data = $read(database.txt,w,%search $+ *,%currentline)
    if (%data != $null) {
      write temp.txt %data
      inc %total
      var %currentline = $readn
    }
    inc %currentline
  }
  write temp.txt %total found.
  play $chan temp.txt 1500
  .remove temp.txt
}


Invision Support
#Invision on irc.irchighway.net