You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
numberstation/winbatch/encode-and-play.bat

56 lines
1.3 KiB

@echo off
setlocal
:: Initialize flags
set flags=
:: Ask for the shift value
set /p shift="Enter the shift value: "
:: Ask for the group size
set /p gsize="Enter the number group size: "
:: MULTI-LINE INPUT NOT SUPPORTED BY BATCH
:: :: Ask for the line size
:: set /p lsize="Enter the number of groups per line: "
:: Ask whether to repeat number groups
set /p repeat="Do you want to repeat number groups (y/N)? "
:: Ask whether to use the alt voice
set /p lowvoice="Do you want to use the alternate voice (y/N)? "
:: Ask for the message input
echo.
echo Enter the message to encode and process:
set /p input=
:: Check if the user wants to repeat number groups
if /i "%repeat%"=="y" (
echo Repeating number groups with the -r flag.
set flags=%flags% -r
) else (
echo Not repeating number groups.
)
:: Check if the user wants to use the alt voice
if /i "%lowvoice%"=="y" (
echo Using alternate voice with the -a flag.
set flags=%flags% -a
) else (
echo Using default voice.
)
:: Pipe the input into nsencode.exe with the shift value, then pipe nsencode.exe's output into numberstation.exe
if defined flags (
echo %input% | nsencode.exe -s %shift% -g %gsize% | numberstation.exe %flags%
) else (
echo %input% | nsencode.exe -s %shift% -g %gsize% | numberstation.exe
)
:: Pause before exit
pause
endlocal