Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::----------------------------------------------------------------------------------------------------------------------------
- ::----------------------------------------------------------------------------------------------------------------------------
- Title RANDOM-BATTLE for M.U.G.E.N by Inktrebuchet
- :: version date = 9-27-2016 ;MM-DD-YYYY
- :: Use in the mugen.exe root folder.
- :: Supports any amount of characters
- :: Randomly battle any of your characters.
- :: Choose your P1 Character by editing the first section below.
- ::----------------------------------------------------------------------------------------------------------------------------
- ::----------------------------------------------------------------------------------------------------------------------------
- ::-----------------------------------------Section for editing your character and matches.------------------------------------
- :: Your character (P1). Examples of how to set: kfm or kfm/kfm.def
- SET your-char= kfm
- :: Your characters (P1) ai. (1=watch mode, 0=random battle)
- SET ai= 1
- :: Number of rounds to win.
- SET rounds= 3
- ::--------------------------------------------------Don't edit past this line--------------------------------------------------
- ::-----------------------------------------------------------------------------------------------------------------------------
- ::counts number of stages in "stages" folder.
- cd stages
- for /f %%a in ('dir /b *.def^|find /c /v "" ') do set scount=%%a
- cd ..
- ::print all stage names in stages.txt
- echo RANDOM-BATTLE STAGES LIST >stages.txt
- cd stages
- dir /b *.def >> ../stages.txt
- cd ..
- :randomly-select-stage
- ::randomly selects a number out of the number of stages in "stages" folder
- SET /A randomstage=%RANDOM% %% %scount% -0
- ::skips to random line in stages.txt to select stage.
- for /F "skip=%randomstage% delims=" %%j in (stages.txt) do set stagename=%%j&goto linerc
- :linerc
- ::tsakes .def off of stage name.
- set stagename=%stagename:~0,-4%
- if "%stagename%"=="" goto randomly-select-stage
- if not exist "stages/%stagename%.def" goto randomly-select-stage
- del stages.txt
- ::-----------------------------------------------------------------------------------------------------------------------------
- ::counts number of characters in "chars" folder.
- for /f %%a in ('dir /b /ad chars %folder%^|find /c /v "" ') do set count=%%a
- Set /A count2= %count% + 1
- ::print all character names in chars.txt
- echo RANDOM-BATTLE CHAR LIST >chars.txt
- dir chars /b >> chars.txt
- echo RANDOM-BATTLE CHAR LIST >chars2.txt
- dir chars /b >> chars2.txt
- :randomly-select
- ::randomly selects a number out of the number of characters in "chars" folder
- SET /A randomchar=%RANDOM% %% %count2% -0
- ::skips to random line in char.txt to select charatcer.
- for /F "skip=%randomchar% delims=" %%i in (chars.txt) do set "randomselect=%%i"&goto linerc
- :randomly-select2
- ::randomly selects a number out of the number of characters in "chars" folder
- SET /A randomchar=%RANDOM% %% %count2% -0
- ::skips to random line in char.txt to select charatcer.
- for /F "skip=%randomchar% delims=" %%i in (chars2.txt) do set "randomselect2=%%i"&goto linerc
- :linerc
- :start-random-battle
- if "%randomselect%"=="" goto randomly-select
- if not exist chars/%randomselect%/%randomselect%.def goto randomly-select
- del chars.txt
- if "%randomselect2%"=="" goto randomly-select
- if not exist chars/%randomselect2%/%randomselect2%.def goto randomly-select
- del chars2.txt
- mugen.exe -rounds %rounds% -p1.ai 1 %randomselect% -p2.ai 1 %randomselect2% -s %stagename%
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement