Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 5.67 KB | None | 0 0
  1. @echo OFF
  2. title L4D Starter - Sabbienized!
  3. setlocal
  4.  
  5.  
  6. find /C "mat_queue_mode" left4dead\cfg\config.cfg>nul
  7. IF ERRORLEVEL 1 GOTO writeMatQueue
  8. IF ERRORLEVEL 0 GOTO chooseConnection
  9. :writeMatQueue
  10. echo mat_queue_mode "0" >> left4dead\cfg\config.cfg
  11.  
  12. :chooseConnection
  13. color 70
  14. CLS
  15. echo L4D Server starter, Sabbienized!
  16. echo --------------------------------
  17. echo What DO you want TO DO?
  18. echo   1.         Use the last used settings!
  19. echo   2.         Be a big strong server!
  20. echo   3.         Be a lousy terminal-like thingie
  21. echo   543251351. GET back TO work!
  22. echo --------------------------------
  23. echo.
  24. set /p gameMode=Server)
  25. IF %gameMode% == 1 GOTO startTheGame
  26. IF %gameMode% == 2 GOTO chooseMap
  27. IF %gameMode% == 3 GOTO enterIp
  28. IF %gameMode% == 543251351 GOTO leaveThis
  29. GOTO chooseConnection
  30.  
  31. :enterIp
  32. color 75
  33. CLS
  34. echo L4D Server starter, Sabbienized!
  35. echo --------------------------------
  36. echo Enter the IP of the server, OR:
  37. echo   1. Last used IP address
  38. echo   0. Shit, what were the previous options again?
  39. echo --------------------------------
  40. echo.
  41. set /p connectIp=IP)
  42. IF %connectIp% == 0 GOTO chooseConnection
  43. IF %connectIp% == 1 GOTO lastUsedIp
  44. GOTO startTheGame
  45. :lastUsedIp
  46. GOTO startTheGame
  47.  
  48. :chooseMap
  49. color 72
  50. CLS
  51. echo L4D Server starter, Sabbienized!
  52. echo --------------------------------
  53. echo Please choose a map:
  54. echo   1. Hospital
  55. echo   2. Farm
  56. echo   3. Airport
  57. echo   4. Smalltown
  58. echo   0. I chose the wrong OPTION in the previous menu
  59. echo --------------------------------
  60. echo.
  61. set /p mapNum=Map)
  62. IF %mapNum% == 0 GOTO chooseConnection
  63. IF %mapNum% == 1 GOTO chooseChapter
  64. IF %mapNum% == 2 GOTO chooseChapter
  65. IF %mapNum% == 3 GOTO chooseChapter
  66. IF %mapNum% == 4 GOTO chooseChapter
  67. GOTO chooseMap
  68.  
  69. :chooseChapter
  70. CLS
  71. echo L4D Server starter, Sabbienized!
  72. echo --------------------------------
  73. echo Please choose a chapter:
  74. GOTO map%mapNum%Chaps
  75. :map1Chaps
  76. echo   1. Apartment
  77. echo   2. Subway
  78. echo   3. Sewers
  79. echo   4. Interior
  80. echo   5. Rooftop
  81. GOTO chooseChapFinal
  82. :map2Chaps
  83. echo   1. Hilltop
  84. echo   2. Traintunnel
  85. echo   3. Bridge
  86. echo   4. Barn
  87. echo   5. Cornfield
  88. GOTO chooseChapFinal
  89. :map3Chaps
  90. echo   1. Greenhouse
  91. echo   2. Offices
  92. echo   3. Garage
  93. echo   4. Terminal
  94. echo   5. Runway
  95. GOTO chooseChapFinal
  96. :map4Chaps
  97. echo   1. Caves
  98. echo   2. Drainage
  99. echo   3. Ranchhouse
  100. echo   4. Mainstreet
  101. echo   5. Houseboat
  102. GOTO chooseChapFinal
  103. :chooseChapFinal
  104. echo   0. I changed my mind about the map thing!
  105. echo --------------------------------
  106. echo.
  107. set /p chapNum=Chapter)
  108. IF %chapNum% == 0 GOTO chooseMap
  109. IF %chapNum% == 1 GOTO setMap%mapNum%Names
  110. IF %chapNum% == 2 GOTO setMap%mapNum%Names
  111. IF %chapNum% == 3 GOTO setMap%mapNum%Names
  112. IF %chapNum% == 4 GOTO setMap%mapNum%Names
  113. IF %chapNum% == 5 GOTO setMap%mapNum%Names
  114. GOTO chooseChapter
  115.  
  116. :setMap1Names
  117. IF %chapNum% == 1 set mapName=l4d_hospital01_apartment
  118. IF %chapNum% == 2 set mapName=l4d_hospital02_subway
  119. IF %chapNum% == 3 set mapName=l4d_hospital03_sewers
  120. IF %chapNum% == 4 set mapName=l4d_hospital04_interior
  121. IF %chapNum% == 5 set mapName=l4d_hospital05_rooftop
  122. GOTO endMapNames
  123. :setMap2Names
  124. IF %chapNum% == 1 set mapName=l4d_farm01_hilltop
  125. IF %chapNum% == 2 set mapName=l4d_farm02_traintunnel
  126. IF %chapNum% == 3 set mapName=l4d_farm03_bridge
  127. IF %chapNum% == 4 set mapName=l4d_farm04_barn
  128. IF %chapNum% == 5 set mapName=l4d_farm05_cornfield
  129. GOTO endMapNames
  130. :setMap3Names
  131. IF %chapNum% == 1 set mapName=l4d_airport01_greenhouse
  132. IF %chapNum% == 2 set mapName=l4d_airport02_offices
  133. IF %chapNum% == 3 set mapName=l4d_airport03_garage
  134. IF %chapNum% == 4 set mapName=l4d_airport04_terminal
  135. IF %chapNum% == 5 set mapName=l4d_airport05_runway
  136. GOTO endMapNames
  137. :setMap4Names
  138. IF %chapNum% == 1 set mapName=l4d_smalltown01_caves
  139. IF %chapNum% == 2 set mapName=l4d_smalltown02_drainage
  140. IF %chapNum% == 3 set mapName=l4d_smalltown03_ranchhouse
  141. IF %chapNum% == 4 set mapName=l4d_smalltown04_mainstreet
  142. IF %chapNum% == 5 set mapName=l4d_smalltown05_houseboat
  143. GOTO endMapNames
  144. :endMapNames
  145.  
  146. :chooseDifficulty
  147. CLS
  148. echo L4D Server starter, Sabbienized!
  149. echo --------------------------------
  150. echo Please choose a difficulty:
  151. echo   1. Easy
  152. echo   2. Medium
  153. echo   3. Hard
  154. echo   4. Impossible
  155. echo   0. I changed my mind about the map thing!
  156. echo --------------------------------
  157. echo.
  158. set /p diffNum=Difficulty)
  159. IF %diffNum% == 0 GOTO chooseMap
  160. IF %diffNum% == 1 set diffName=Easy
  161. IF %diffNum% == 2 set diffName=Medium
  162. IF %diffNum% == 3 set diffName=Hard
  163. IF %diffNum% == 4 set diffName=Impossible
  164. :endDifficulty
  165.  
  166. :startTheGame
  167. CLS
  168. echo L4D Server starter, Sabbienized!
  169. echo.
  170. echo.
  171. echo     Starting Left 4 Dead, please WAIT...
  172. echo.
  173. IF %gameMode% == 1 (
  174.   IF exist lastUsed.dat (
  175.     FOR /f "tokens=1,3*" %%f in ('"type lastUsed.dat"') do (
  176.       echo %date% - %time% :: Game Started :: last settings: %%f %%g %%h >> playingLog.txt
  177.       left4dead.exe %%f %%g %%h
  178.     )
  179.   ) ELSE (
  180.     echo ERROR: No last settings found..
  181.     pause
  182.     GOTO chooseConnection
  183.   )
  184. )
  185. IF %gameMode% == 2 (
  186.   echo %date% - %time% :: Game Started :: %mapName% ON %diffName% >> playingLog.txt
  187.   left4dead.exe -game left4dead -console -novid +sv_allow_lobby_connect_only 0 +z_difficulty %diffName% +map %mapName%
  188.   echo -game left4dead -console -novid +sv_allow_lobby_connect_only 0 +z_difficulty %diffName% +map %mapName% > lastUsed.dat
  189. )
  190. IF %gameMode% == 3 (
  191.   echo %date% - %time% :: Game Started :: Connecting TO %connectIp% >> playingLog.txt
  192.   left4dead.exe -game left4dead -console -novid +connect %connectIp%
  193.   echo -game left4dead -console -novid +connect %connectIp% > lastUsed.dat
  194. )
  195. echo %date% - %time% :: Game ended >> playingLog.txt
  196. :leaveThis
  197. endlocal
  198. color
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement