![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Sparks
Join Date: Dec 2001
Location: South Wales
Posts: 248
Downloads: 158
Uploads: 0
|
![]()
To randomize the ogg files in your gramophone directory.
First backup your tracks to another folder. Cut and copy the code below into a new notepad file and save any name you like with a .bat extension. Save in your gramophone folder. I then created a shortcut on my desktop to to run it from there or you can go into the folder and run it from there also before starting your SH3 session. I am been running it for some time now and it is fine with 58 ogg files. I shall be adding more. Here is the code, I accept no responsibility if you have a problem. Please note you will lose original file names and new "names" will be generated each time the bat file is run. @@echo off setlocal enabledelayedexpansion :: Define directory (change if needed) set "music_dir=%CD%" :: Change to the directory with the OGG files cd /d "%music_dir%" :: Create a temporary file list set "tmpfile=randomlist.tmp" dir /b *.ogg > "%tmpfile%" :: Loop through each file and rename it with an 8-digit random number for /f "tokens=*" %%A in (%tmpfile%) do ( set /a randnum=!random! * 100000 + !random! %% 100000 ren "%%A" "!randnum!.ogg" ) :: Clean up temp file del "%tmpfile%" echo Files randomized successfully with fixed-length filenames. pause
__________________
Now this is the Law of the Jungle -- as old and as true as the sky; And the Wolf that shall keep it may prosper, but the Wolf that shall break it must die. As the creeper that girdles the tree-trunk the Law runneth forward and back -- For the strength of the Pack is the Wolf, and the strength of the Wolf is the Pack. |
![]() |
![]() |
![]() |
#2 |
Expert Shipsinker
Join Date: Feb 2007
Location: Baltimore,Md./ CA45
Posts: 913
Downloads: 360
Uploads: 0
|
![]()
Thanx, much needed, I have about 620 selections and only the first tunes, over and over.
__________________
ONEALEX 1.53 ARB / NYGM "ENHANCED Steel Coffin Edition" v7.8 DGUI / CCom12 DGUI / WAC 5.2 DGUI / Toyotagt86 v2.3 ARB / GWX3 DGUI / GWX Knight's Cross v1 |
![]() |
![]() |
![]() |
#3 |
Expert Shipsinker
Join Date: Feb 2007
Location: Baltimore,Md./ CA45
Posts: 913
Downloads: 360
Uploads: 0
|
![]()
Works perfectly. If ya ever find yourself in CA45 (Baltimore Md), I owe ya a beer
__________________
ONEALEX 1.53 ARB / NYGM "ENHANCED Steel Coffin Edition" v7.8 DGUI / CCom12 DGUI / WAC 5.2 DGUI / Toyotagt86 v2.3 ARB / GWX3 DGUI / GWX Knight's Cross v1 |
![]() |
![]() |
![]() |
#4 | |
Sparks
Join Date: Dec 2001
Location: South Wales
Posts: 248
Downloads: 158
Uploads: 0
|
![]() Quote:
![]()
__________________
Now this is the Law of the Jungle -- as old and as true as the sky; And the Wolf that shall keep it may prosper, but the Wolf that shall break it must die. As the creeper that girdles the tree-trunk the Law runneth forward and back -- For the strength of the Pack is the Wolf, and the strength of the Wolf is the Pack. |
|
![]() |
![]() |
![]() |
|
|