When you do /mp3stats prodigy the script uses $findfile to count the files that match *.mp3 (to find the total mp3 files) then it uses $findfile again to count the files that match *prodigy* which returns 77 in this case.
When you do /mp3stats * the script searches for *.mp3 as before, but now it searches for * which matches EVERYTHING in that folder, including files that are NOT mp3s.
The changes given in the second example above should fix the problem, except I would change this line:
var %wild.card = $+(*,$replace($$1-,$chr(32),*),*.mp3)
to this:
var %wild.card = $+(*,$replace($$1-,$chr(32),*,.mp3,),*.mp3)
in case someone searches for *prodigy*breath*.mp3 the .mp3 will be removed so it isn't duplicated by the code.
-genius_at_work
Last edited by genius_at_work; 05/07/06 01:00 AM.