-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add B2STools/B2SRandom.cmd to randomize many Backglasses when activat…
…ed in Pinup Popper or similar
- Loading branch information
1 parent
f006180
commit 438d2fc
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@echo off | ||
REM ___ ___ ___ | ||
REM | _ )_ ) __| | ||
REM | _ \/ /\__ \ | ||
REM |___/___|___/ Random | ||
REM | ||
REM This script can be used to randomize different backglasses before starting Visual Pinball | ||
REM | ||
REM To activate it, add the following line in the Popper Launch script | ||
REM CALL C:\vPinball\B2SServer\B2STools\B2SRandom.cmd "[GAMEFULLNAME]" | ||
REM | ||
REM If you start a table "table.vpx" in the folder "D:\vPinball\VisualPinball\Tables\" it will try to find | ||
REM D:\vPinball\VisualPinball\Tables\table-#.directb2s where # is a random number. | ||
REM If it is found, the file D:\vPinball\VisualPinball\Tables\table-#.directb2s is copied over D:\vPinball\VisualPinball\Tables\table.directb2s | ||
|
||
REM Extract path + name without extension | ||
set b2sfullname=%~dpn1 | ||
|
||
REM Uncomment following line to log how this script was called. | ||
REM echo %0 %* >> %0.log | ||
|
||
REM Count the amount of b2sfullname-?.directb2s alt directb2s files there is. | ||
for /F %%i in ('dir /A:-D /B "%b2sfullname%-?.directb2s" 2^>nul ^| find /c /v ""') do set COUNT=%%i | ||
|
||
REM Step out if there is no alt directb2s files available | ||
if %COUNT% == 0 goto :EOF | ||
|
||
REM Generate random number between 1 and the %COUNT% | ||
set /a num=%random% %%%COUNT% + 1 | ||
|
||
if not exist "%b2sfullname%-%num%.directb2s" goto :EOF | ||
|
||
copy /Y "%b2sfullname%-%num%.directb2s" "%b2sfullname%.directb2s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters