omg omg omg lol no its not that bad.

your code while constructully sound, has a major flaw in it, that is that when doing a $findfile(%mp3dir,*.mp3,*) it processes through the folder and subfolders locating every mp3.
U do this once for every repeat of the loop becuase you scan the folder/subfolders for the total mp3's within the WHILE condition check.
Then inisde the loop you do a similar thing when you ask for the %num'th mp3 it scans from the first one to the %num'th one to get you it.
This results in 1.5 entire folder/subfolder scans for EACH mp3 that you proccessed.

[edit]
Just read the above and I dont know if i explained it well.
amaigine its like you want to write down the name of everyone in another room, so you start at 1 and ask BOB to count the people in the room, he goes counts them , comes back and says 78, so you ask bob to go get person 1's name, he goes in go to person 1 gets there name and comes back, Now your at 2 so u aask Bob to go count the people, he goes and counts them all and comes back and says 78, so u ask bob to go get person number 2's name, he goes in counts people tell he reaches number 2, gets there name,and comes back. Now your at 3 so u aask Bob to go count the people, he goes and counts them all and comes back and says 78, so u ask bob to go get person number 3's name, he goes in counts people tell he reaches number 3, gets there name, you can see where this is going, and how uneconomic it is.

Below is like saying "bob go count the people in the room, and while counting them write there names down"

[edit]

Below is likely the minimal code you can get away with, it uses $findfile's ability to execute a command for each file it finds

Code:
alias create.playlist.mp3 { 
  write -c Remotes\mp3.txt 
  .echo -q $findfile(%mp3dir,*.mp3,*,write Remotes\mp3.txt $remove($1-,%mp3dir))
} 


Now that well be alot faster, but then it might still not be fast enough, so here is how to add whilefix.dll

Code:
alias create.playlist.mp3 { 
  write -c Remotes\mp3.txt 
  .echo -q $findfile(%mp3dir,*.mp3,*,create.playlist.mp3.file $1-)
} 
alias -l create.playlist.mp3.file {
  write Remotes\mp3.txt $remove($1-,%mp3dir))
  dll WhileFix.dll WhileFix
}

I now call an alias that writes the file and then calls whilefix.dll ***NOTE the second "WhileFix" must be capitalised as it shows else it doesnt work***

Unfortunitly in using $findfile, you can still get large delays, becuase it can take considerable time scanning through folders etc that have no matching files, so the alias does not get called, you can change the match text from *.mp3 to *.* and then check inside the called alias, but i find that in most cases this makes the script take a hugely greater time, but not "freeze" mirc. For your app looking in your mp3 folder, i would try the first option then the second one if its still to slow.

Last edited by DaveC; 24/01/05 09:27 AM.