Advertisement
Guest User

runmapperxp.bat

a guest
Aug 1st, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. rem @echo off
  2. :: Some Launcher for the Minetest-Mapper using WizApp for eyecandy
  3. :: Place this folder in the folder the minetest-mapper.exe is in
  4. :: so that the mapper is in the parent folder of this.
  5. :: no color choosing and some default geometry as of yet.
  6. :: more might come
  7. :: this file is all cco
  8. :: except where I kopied ideas from others that didn't state a license
  9. :: The creator wishes to not be held responsible
  10. :: for any havoc it may create - this is a batch file!
  11. :: Use with care, it will not ask before destroying your pc.
  12. :: The creator of this file may be found roaming the minetest servers,
  13. :: IRC or the forums at minetest.net as twoelk
  14.  
  15. :letsbegin
  16. set page=:letsbegin
  17. set watitle=Minetest Mapper Batch wraparound
  18. set wabmp=minetest-icon-120.bmp
  19. set watext=~This is a version that may sort of run on XP.~~The "Back" and "Cancel" buttons will NOT work on most pages, so use at own risk.
  20. set watext1=~Behavior on Vista or later may be totally different. Please use the normal runmapper.bat on those.
  21. set watext2=~~~This is a container driven by batch files that may aid in using the command line tool Minetest Mapper.~do you want to continue?~~Press OK if you do.~Press Cancel if you do not.
  22. set walabels=;OK
  23. set wabat=wabatconfigs.bat
  24. set waoutput=
  25. set wainput=
  26. start /w wizapp NOBACK TB
  27. set watext=
  28. set watext1=
  29. set watext2=
  30. set walabels=
  31.  
  32. if errorlevel 2 goto :cancel
  33. if errorlevel 0 if not errorlevel 2 echo Then let's continue.
  34. set previous=:letsbegin
  35. goto page3
  36.  
  37. :page2
  38. set page=:page2
  39.  
  40. set watext=~~Choose a language you want the program to run in:
  41. set wainput= ^&English; ^&German
  42. set waoutnum=0
  43. set wabmp=minetest-icon-120.bmp
  44. start /w wizapp RB
  45. call %wabat%
  46. if "%waoutnum%"=="0" set language=English
  47. if "%waoutnum%"=="1" set language=German
  48. set waoutput=
  49. set wainput=
  50. set waoutnum=
  51.  
  52. if errorlevel 2 goto :cancel
  53. if errorlevel 1 goto %previous%
  54. set previous=:page2
  55.  
  56.  
  57. :page3
  58. set page=:page3
  59. set watext=~~Choose the folder of a Minetest World to map:
  60. set walistsep=,
  61. set waoutput=
  62. start /w wizapp FB DIR
  63. call %wabat%
  64. set world_dir=%waoutput%
  65. set watext=
  66. set walistsep=
  67. set waoutput=
  68.  
  69. if errorlevel 0 goto :page4
  70. if errorlevel 1 goto %previous%
  71. if errorlevel 2 goto :cancel
  72. set previous=:page3
  73.  
  74.  
  75. :page4
  76. set page=:page4
  77. echo The world is in: %world_dir%
  78. if exist %world_dir%\map.sqlite goto :treasurehunt
  79. set watext=Sorry, the world path does not seem to be valid. Please try again.
  80. start /w wizapp MB STOP
  81. goto %previous%
  82. :treasurehunt
  83. echo in treasurhunt now
  84. set watext=~~Write an output file name or keep the suggested (Map+World-Name+IsoDate.png)
  85. set inputstring=%world_dir%
  86. set treasure=worlds
  87. set found=notyet
  88. :searchloop
  89. for /f "tokens=1* delims=\" %%a in ("%inputstring%") do set found=%%a&set rest=%%b
  90. if %found%==%treasure% goto :foundtreasure
  91. set inputstring=%rest%
  92. if "%rest%"=="" goto :page3
  93. goto searchloop
  94. :foundtreasure
  95. set worldname=%rest%
  96. :findisodate
  97. set isodate=%date:~6,4%%date:~3,2%%date:~0,2%T%time:~0,2%%time:~3,2%
  98. set isodate=%isodate: =0%
  99.  
  100. set waoutput=Map-%worldname%-%isodate%.png
  101. start /w wizapp EB
  102. call %wabat%
  103. set filename=%waoutput%
  104. echo file name is %waoutput%
  105. set watext=
  106. set waoutput=
  107. set inputstring=
  108. set treasure=
  109. set found=
  110. set rest=
  111.  
  112. if errorlevel 0 goto :page5
  113. if errorlevel 2 goto :cancel
  114. if errorlevel 1 goto %previous%
  115. set previous=:page4
  116.  
  117.  
  118. :page5
  119. set page=:page5
  120. set watext=~~Choose something:
  121. set wainput=--drawscale --drawplayers --draworigin
  122. for %%c in (0 1 2) do set chk%%c=
  123. for %%c in (%waoutnum%) do set chk%%c=1
  124. if "%chk0%"=="1" echo drawscale was checked
  125. if "%chk1%"=="1" echo drawplayers was checked
  126. if "%chk2%"=="1" echo draworigin was checked
  127. start /w wizapp CL
  128. call %wabat%
  129. set parameters1=%waoutput%
  130. set waoutput=
  131. set wainput=
  132.  
  133. if errorlevel 0 goto :collectingdata
  134. if errorlevel 2 goto :cancel
  135. if errorlevel 1 goto %previous%
  136. set previous=:page5
  137.  
  138.  
  139. :collectingdata
  140. set page=:collectingdata
  141. set runcommando=minetest_mapper.exe -i %world_dir% -o %filename% %parameters1% --geometry -6000:-6000+12000+12000 >>configinfo.txt
  142.  
  143. echo _____________________>configinfo.txt
  144. echo Die gespeicherten Variablen>>configinfo.txt
  145. echo _____________________>>configinfo.txt
  146. echo The chosen language is: %language%>>configinfo.txt
  147. echo The world is in: %world_dir%>>configinfo.txt
  148. echo The map file shall be called: %filename%>>configinfo.txt
  149. echo The parameters are: %parameters1%>>configinfo.txt
  150. echo _____________________>>configinfo.txt
  151. echo The resulting command would be:>>configinfo.txt
  152. echo _____________________>>configinfo.txt
  153. echo %runcommando%>>configinfo.txt
  154. del wabatconfigs.bat
  155.  
  156. rem if errorlevel 2 goto :cancel
  157. rem if errorlevel 1 goto %previous%
  158. rem set previous=:collectingdata
  159. rem if errorlevel 0 goto :showdata
  160.  
  161.  
  162. :showdata
  163. set page=:showdata
  164. set wafile=configinfo.txt
  165. set watext=The collected data:
  166. start /w wizapp FT
  167. set wafile=
  168. set watext=
  169.  
  170. if errorlevel 0 goto :makemap
  171. if errorlevel 2 goto :cancel
  172. if errorlevel 1 goto %previous%
  173. set previous=:showdata
  174.  
  175.  
  176. :makemap
  177. set page=:makemap
  178. set watext=Shall the map be made?
  179. start /w wizapp MB QUESTION
  180. set watext=
  181.  
  182. if errorlevel 0 goto :checkformapper
  183. if errorlevel 2 goto :cancel
  184. if errorlevel 1 goto %previous%
  185. set previous=:makemap
  186.  
  187. :checkformapper
  188. if "%mapperpath%"=="" set mapperpath=..\
  189. if exist %mapperpath%minetest_mapper.exe goto :runmapper
  190. set watext=Sorry, the Minetest-mapper.exe cannot be found. ~Please make sure it is in the parent folder of this batch file and try again.
  191. start /w wizapp MB STOP
  192. goto %previous%
  193.  
  194. :runmapper
  195. set page=:runmapper
  196. set home=%cd%
  197. cd ..
  198. %runcommando%>>runme.bat
  199. echo .. please wait a bit ..
  200. call runme.bat
  201. dir
  202. pause
  203. cd %home%
  204.  
  205. set watext=Do you want to make another map?
  206. start /w wizapp MB QUESTION
  207. set watext=
  208.  
  209. if errorlevel 2 goto :cancel
  210. if errorlevel 0 goto :page3
  211.  
  212.  
  213. :cancel
  214. set page=
  215. set watitle=
  216. set wabmp=
  217. set watext=
  218. set previous=
  219. set wainput=
  220. set waoutnum=
  221. set wabat=
  222. set walistsep=
  223. set waoutput=
  224. :end
  225. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement