_build-all.bat 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. @echo off
  2. REM Start the program
  3. GOTO :Main
  4. REM # ================================================================================================
  5. REM # Documentation
  6. REM # Spine of the program; this makes sure that the execution works as intended.
  7. REM # ================================================================================================
  8. :Main
  9. REM Update the terminal window title
  10. TITLE Realm667 Batch Selector by Ozymandias81
  11. CALL :MainMenu
  12. GOTO :TerminateProcess
  13. REM # ================================================================================================
  14. REM # Documentation
  15. REM # Displays the main menu
  16. REM # ================================================================================================
  17. :MainMenu
  18. REM Thrash the terminal buffer
  19. CLS
  20. ECHO --------------------------------------------------------------
  21. ECHO Welcome to Ozy's R667s Batch Selector, choose a game by typing
  22. ECHO the relative entry and press ENTER. Choices have been setup
  23. ECHO all under QWERTY keyboards.
  24. ECHO --------------------------------------------------------------
  25. ECHO.
  26. ECHO [1] Build All
  27. ECHO [2] Austerity
  28. ECHO [3] KDiZD
  29. ECHO [4] Sapphire
  30. ECHO [5] Stronghold
  31. ECHO [6] TCOTD1
  32. ECHO [7] TCOTD2
  33. ECHO [8] The Refinery
  34. ECHO [9] TUTNT Complete
  35. ECHO [0] TUTNT Episode 1
  36. ECHO [a] TUTNT Episode 2
  37. ECHO [b] TUTNT Episode 3
  38. ECHO [c] TUTNT Episode LE
  39. ECHO [d] ZDCMP1
  40. ECHO [e] ZDCMP2
  41. ECHO [f] ZPack
  42. ECHO.
  43. ECHO [.] Exit
  44. ECHO -----------------------------------------------------
  45. REM Capture the user input
  46. CALL :PromptUserInput
  47. REM Inspect the input
  48. GOTO :MainMenu_STDIN
  49. REM # ================================================================================================
  50. REM # Documentation
  51. REM # This function captures the standard input from the user.
  52. REM # ================================================================================================
  53. :PromptUserInput
  54. SET /P STDIN=^>^>^>^>
  55. GOTO :EOF
  56. REM # ================================================================================================
  57. REM # Documentation
  58. REM # Inspect the user's input and execute their desired action
  59. REM # ================================================================================================
  60. :MainMenu_STDIN
  61. IF "%STDIN%" EQU "1" (
  62. CALL all_build.bat
  63. GOTO :MainMenu
  64. )
  65. IF "%STDIN%" EQU "2" (
  66. CALL austerity_build.bat
  67. GOTO :MainMenu
  68. )
  69. IF "%STDIN%" EQU "3" (
  70. CALL kdizd_build.bat
  71. GOTO :MainMenu
  72. )
  73. IF "%STDIN%" EQU "4" (
  74. CALL sapphire_build.bat
  75. GOTO :MainMenu
  76. )
  77. IF "%STDIN%" EQU "5" (
  78. CALL stronghold_build.bat
  79. GOTO :MainMenu
  80. )
  81. IF "%STDIN%" EQU "6" (
  82. CALL tcotd1_build.bat
  83. GOTO :MainMenu
  84. )
  85. IF "%STDIN%" EQU "7" (
  86. CALL tcotd2_build.bat
  87. GOTO :MainMenu
  88. )
  89. IF "%STDIN%" EQU "8" (
  90. CALL therefinery_build.bat
  91. GOTO :MainMenu
  92. )
  93. IF "%STDIN%" EQU "9" (
  94. CALL tutnt_build.bat
  95. GOTO :MainMenu
  96. )
  97. IF "%STDIN%" EQU "0" (
  98. CALL tnte1_build.bat
  99. GOTO :MainMenu
  100. )
  101. IF "%STDIN%" EQU "a" (
  102. CALL tnte2_build.bat
  103. GOTO :MainMenu
  104. )
  105. IF "%STDIN%" EQU "b" (
  106. CALL tnte3_build.bat
  107. GOTO :MainMenu
  108. )
  109. IF "%STDIN%" EQU "c" (
  110. CALL tntele_build.bat
  111. GOTO :MainMenu
  112. )
  113. IF "%STDIN%" EQU "d" (
  114. CALL zdcmp1_build.bat
  115. GOTO :MainMenu
  116. )
  117. IF "%STDIN%" EQU "e" (
  118. CALL zdcmp2_build.bat
  119. GOTO :MainMenu
  120. )
  121. IF "%STDIN%" EQU "f" (
  122. CALL zpack_build.bat
  123. GOTO :MainMenu
  124. )
  125. IF /I "%STDIN%" EQU "." (
  126. GOTO :EOF
  127. )
  128. IF /I "%STDIN%" EQU "U" (
  129. CALL :MainMenu_STDIN_BadInput
  130. GOTO :MainMenu
  131. )
  132. REM # ================================================================================================
  133. REM # Documentation
  134. REM # This function displays a message to the user that the STDIN was illegal and not supported
  135. REM # ================================================================================================
  136. :MainMenu_STDIN_BadInput
  137. ECHO.
  138. ECHO ---------------------------- ERROR: INVALID OPTION -----------------------------
  139. ECHO The provided input from the user is not either valid or supported.
  140. ECHO Please select from the choices provided.
  141. ECHO.
  142. ECHO REMINDER:
  143. ECHO If you get stuck with selector, simply close the window or press CTRL+LSHIFT+C
  144. ECHO ---------------------------- ERROR: INVALID OPTION -----------------------------
  145. ECHO.
  146. PAUSE
  147. GOTO :MainMenu
  148. REM # ================================================================================================
  149. REM # Documentation
  150. REM # Terminate the program without destroying the console process if invoked via CUI.
  151. REM # ================================================================================================
  152. :TerminateProcess
  153. ECHO Closing program. . .
  154. REM Restore the terminal window's title to something generic
  155. TITLE Command Prompt
  156. EXIT /B 0