Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.58 KB | None | 0 0
  1. ::----------------------------------------------------------------------------------------------------------------------------
  2. ::----------------------------------------------------------------------------------------------------------------------------
  3. Title RANDOM-BATTLE for M.U.G.E.N by Inktrebuchet
  4. :: version date = 9-27-2016     ;MM-DD-YYYY
  5. :: Use in the mugen.exe root folder.
  6. :: Supports any amount of characters
  7. :: Randomly battle any of your characters.
  8. :: Choose your P1 Character by editing the first section below.
  9. ::----------------------------------------------------------------------------------------------------------------------------
  10. ::----------------------------------------------------------------------------------------------------------------------------
  11.  
  12. ::-----------------------------------------Section for editing your character and matches.------------------------------------
  13.  
  14. :: Your character (P1). Examples of how to set:   kfm   or   kfm/kfm.def
  15. SET your-char= kfm
  16.  
  17. :: Your characters (P1) ai. (1=watch mode, 0=random battle)
  18. SET ai= 1
  19.  
  20. :: Number of rounds to win.
  21. SET rounds= 3
  22.  
  23. ::--------------------------------------------------Don't edit past this line--------------------------------------------------
  24. ::-----------------------------------------------------------------------------------------------------------------------------
  25.  
  26. ::counts number of stages in "stages" folder.
  27. cd stages
  28. for /f %%a in ('dir /b *.def^|find /c /v "" ') do set scount=%%a
  29. cd ..
  30.  
  31.  
  32. ::print all stage names in stages.txt
  33. echo RANDOM-BATTLE STAGES LIST >stages.txt
  34. cd stages
  35. dir /b *.def >> ../stages.txt
  36. cd ..
  37.  
  38. :randomly-select-stage
  39.  
  40. ::randomly selects a number out of the number of stages in "stages" folder
  41. SET /A randomstage=%RANDOM% %% %scount% -0
  42.  
  43. ::skips to random line in stages.txt to select stage.
  44. for /F "skip=%randomstage% delims=" %%j in (stages.txt) do set stagename=%%j&goto linerc
  45. :linerc
  46. ::tsakes .def off of stage name.
  47. set stagename=%stagename:~0,-4%
  48.  
  49. if "%stagename%"=="" goto randomly-select-stage
  50. if not exist "stages/%stagename%.def" goto randomly-select-stage
  51. del stages.txt
  52.  
  53.  
  54. ::-----------------------------------------------------------------------------------------------------------------------------
  55. ::counts number of characters in "chars" folder.
  56. for /f %%a in ('dir /b /ad chars %folder%^|find /c /v "" ') do set count=%%a
  57. Set /A count2= %count% + 1
  58.  
  59. ::print all character names in chars.txt
  60. echo RANDOM-BATTLE CHAR LIST >chars.txt
  61. dir chars /b >> chars.txt
  62. echo RANDOM-BATTLE CHAR LIST >chars2.txt
  63. dir chars /b >> chars2.txt
  64.  
  65. :randomly-select
  66.  
  67. ::randomly selects a number out of the number of characters in "chars" folder
  68. SET /A randomchar=%RANDOM% %% %count2% -0
  69.  
  70. ::skips to random line in char.txt to select charatcer.
  71. for /F "skip=%randomchar% delims=" %%i in (chars.txt) do set "randomselect=%%i"&goto linerc
  72.  
  73. :randomly-select2
  74.  
  75. ::randomly selects a number out of the number of characters in "chars" folder
  76. SET /A randomchar=%RANDOM% %% %count2% -0
  77.  
  78. ::skips to random line in char.txt to select charatcer.
  79. for /F "skip=%randomchar% delims=" %%i in (chars2.txt) do set "randomselect2=%%i"&goto linerc
  80.  
  81. :linerc
  82.  
  83. :start-random-battle
  84. if "%randomselect%"=="" goto randomly-select
  85. if not exist chars/%randomselect%/%randomselect%.def goto randomly-select
  86. del chars.txt
  87.  
  88. if "%randomselect2%"=="" goto randomly-select
  89. if not exist chars/%randomselect2%/%randomselect2%.def goto randomly-select
  90. del chars2.txt
  91.  
  92. mugen.exe -rounds %rounds% -p1.ai 1 %randomselect% -p2.ai 1 %randomselect2% -s %stagename%
  93. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement