1
0

MakeQSP.bat 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @ECHO off
  2. :: Set those lines to fit your setup.
  3. :: This is where glife.qsp will be copied. If you don't want to move it just comment (::) the line below.
  4. :: set CP_TO=..\GL_ECV
  5. :: This is the program used to open glife.qsp. If you comment this line windows will launch the default app to open glife.qsp
  6. set QSPGUI=QSP\qspgui.exe
  7. set QGEN=QSP\QGen5\QGen.exe
  8. :: The file that will be generated or open
  9. set QSPFILE=glife.qsp
  10. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. :menu
  12. cls
  13. echo.
  14. echo :: QSP Compiler and Launcher
  15. echo.
  16. if defined QGEN (
  17. if not exist "%QGEN%" (
  18. echo QGEN : [ERROR] - %QGEN% not found. Using DEFAULT application.
  19. set QGEN=
  20. ) else ( echo QGEN : [OK] - "%QGEN%")
  21. ) else echo QGEN : [NOT DEFINED] - Using DEFAULT application.
  22. if defined QSPGUI (
  23. if not exist "%QSPGUI%" (
  24. echo QSP EXEC : [ERROR] - %QSPGUI% not found.
  25. set QSPGUI=
  26. ) else ( echo QSP EXEC : [OK] - "%QSPGUI%")
  27. ) else ( echo QSP EXEC : [NOT DEFINED] - Using Windows DEFAULT.)
  28. if defined QSPFILE (
  29. if not exist "%QSPFILE%" (
  30. echo QSP FILE : [WARNING] - %QSPFILE% not found.
  31. ) else ( echo QSP FILE : [OK] - "%QSPFILE%")
  32. ) else ( echo QSP FILE : [NOT DEFINED] - ERROR: CAN'T CONTINUE.)
  33. if defined CP_TO (
  34. if not exist "%CP_TO%" (
  35. echo COPY : [ERROR] - Destination "%CP_TO%" not found. Copy DISABLED.
  36. set CP_TO=
  37. ) else ( echo COPY : [OK] - "%CP_TO%")
  38. ) else ( echo COPY : [DISABLED] )
  39. echo.
  40. if defined NOT_FOUND (
  41. echo ERROR: Option '%action%' wasn't recognized. Is it lowercase?
  42. set NOT_FOUND=
  43. )
  44. echo.
  45. echo ACTIONS: (B)uild (R)un (F)ull (Q)Gen (E)xit
  46. echo.
  47. set /p action=Choose an action:
  48. if defined QSPFILE (
  49. if %action% == b goto build
  50. if %action% == r goto run
  51. if %action% == f goto build
  52. if %action% == q goto qgen
  53. )
  54. if %action% == e goto exit
  55. set NOT_FOUND=1
  56. goto menu
  57. :build
  58. echo.
  59. echo Building ...
  60. @ECHO ON
  61. python -3 txtmerge.py locations glife.txt
  62. txt2gam.exe glife.txt %QSPFILE% > nul
  63. @ECHO OFF
  64. echo.
  65. if defined CP_TO ( echo Copying %QSPFILE% to "%CP_TO%" ... & copy %QSPFILE% %CP_TO% > nul )
  66. echo.
  67. echo Done.
  68. pause
  69. if %action% == f ( goto run ) else ( goto menu )
  70. :qgen
  71. echo.
  72. echo Running ...
  73. if defined CP_TO ( start %QGEN% %CP_TO%\%QSPFILE% ) else ( start %QGEN% %QSPFILE% )
  74. goto exit
  75. :run
  76. echo.
  77. echo Running ...
  78. if defined CP_TO ( start %QSPGUI% %CP_TO%\%QSPFILE% ) else ( start %QSPGUI% %QSPFILE% )
  79. :exit