View Single Post
  #16  
Old 01-25-2013, 11:31 PM
mrburns mrburns is offline
Approved Member
 
Join Date: Mar 2008
Posts: 22
Default

Here's a shorter version. It's self-contained, not relying on the vb script.
It still uses the RADIO_SOURCE folder to get the songs and COPIES them into their respective folders.

GAMEPATH = C:\Ubisoft\IL2_Current
prependCount := 999 ;for renaming radio wav files

RandomizeMusic()
{
global GAMEPATH, prependCount

Loop, %GAMEPATH%\samples\Music\Radio\*.*, 1, 0 ;non-recurse into subfolders
{
FileDelete, %A_LoopFileFullPath%\*.wav
}

Loop, %GAMEPATH%\samples\Music\Radio_Source\*.wav, , 1 ;recurse into subfolders
{
Filename = %A_LoopFileFullPath%
Random, num, 100,999
StringReplace, Name, Filename, Radio_Source, Radio
StringReplace, Filename, Name, %A_LoopFileName%, %prependCount%_%num%_%A_LoopFileName%
FileCopy, %A_LoopFileFullPath%, %Filename%
}

prependCount := prependCount - 1
}
Reply With Quote