


@echo off

echo *****************************************************
echo *                                                   *
echo *     Doom/Doom2/Heretic/Hexen Batch file creator   *
echo *                  and launcher                     *
echo *                    V. 1.3                         *
echo *              by Mark David Bowman                 *
echo *                                                   *
echo *****************************************************
%nolog% echo **************New session log****************>>%doombat%doombat.log

:doom12
echo *******************************************************
echo *  Do you want to launch Doom or create a batch file? *
echo *******************************************************                        
echo A=Launch Doom/Heretic/Hexen
echo B=Create Batch file
echo Hit ctrl+c to exit
echo.
echo.
echo Type A or B, and hit enter when ready

%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat
%nolog% if "%lok%"=="A" echo Launch Doom/Heretic/Hexen selected>>%doombat%doombat.log 
%nolog% if "%lok%"=="B" echo Create batch file selected>>%doombat%doombat.log
%nolog% if "%lok%"=="a" echo Launch Doom/Heretic/Hexen selected>>%doombat%doombat.log 
%nolog% if "%lok%"=="b" echo Create batch file selected>>%doombat%doombat.log
if "%lok%"=="A" echo Launch Doom/Heretic/Hexen
if "%lok%"=="B" echo Create Batch file
if "%lok%"=="a" echo Launch Doom/Heretic/Hexen
if "%lok%"=="b" echo Create batch file
if "%lok%"=="A" goto launch
if "%lok%"=="B" goto nolaunch
if "%lok%"=="a" goto launch
if "%lok%"=="b" goto nolaunch
goto doom12
:launch
set batchfile=no
goto zaqq

:nolaunch
set batchfile=yes
:zaqq

if %batchfile% == no goto doomvers
echo.
echo.
echo *******************************************************
echo * What name do you want to give your Doom batch file? *
echo * Enter a name that is no more than 8 characters      *
echo *       or hit ctrl+c to leave program                *
echo *******************************************************
echo.
echo.
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat

set dmbat=%lok%
echo Creating batch file %dmbat%.bat
%nolog% echo Batch file name: %lok%.bat>>%doombat%doombat.log
:doomvers
echo.
echo.
echo Are you using Doom 1 or 2, Heretic or Hexen?  
echo A=Doom1
echo B=Doom2
echo C=Heretic
echo D=Hexen
echo Hit ctrl+c to exit
echo.
echo.
echo Type A, B, C or D and hit enter when ready

%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat
%nolog% if "%lok%"=="A" echo Doom version: Doom 1>>%doombat%doombat.log 
%nolog% if "%lok%"=="B" echo Doom version: Doom 2>>%doombat%doombat.log
%nolog% if "%lok%"=="a" echo Doom version: Doom 1>>%doombat%doombat.log 
%nolog% if "%lok%"=="b" echo Doom version: Doom 2>>%doombat%doombat.log
%nolog% if "%lok%"=="d" echo Other game: Hexen>>%doombat%doombat.log
%nolog% if "%lok%"=="D" echo Other game: Hexen>>%doombat%doombat.log
%nolog% if "%lok%"=="c" echo Other game: Heretic>>%doombat%doombat.log
%nolog% if "%lok%"=="C" echo Other game: Heretic>>%doombat%doombat.log
if "%lok%"=="A" echo Doom version: Doom 1
if "%lok%"=="B" echo Doom version: Doom 2
if "%lok%"=="a" echo Doom version: Doom 1
if "%lok%"=="b" echo Doom version: Doom 2
if "%lok%"=="D" echo Other game: Hexen
if "%lok%"=="d" echo Other game: Hexen
if "%lok%"=="C" echo Other game: Heretic
if "%lok%"=="c" echo Other game: Heretic
if "%lok%"=="A" goto doom1
if "%lok%"=="B" goto doom2
if "%lok%"=="a" goto doom1
if "%lok%"=="b" goto doom2
if "%lok%"=="D" goto hexen
if "%lok%"=="d" goto hexen
if "%lok%"=="C" goto heretic
if "%lok%"=="c" goto heretic
goto doomvers

:doom1
set doombat1=doom
goto next

:doom2
set doombat1=doom2
goto next

:heretic
set doombat1=heretic
goto next

:hexen
set doombat1=hexen

:next
echo **************************************************************************
echo * Which wad files do you want to run? Type in the name of the wad files, *
echo *  S to skip this selection or hit ctrl+c to leave program               *
echo **************************************************************************
%doombatc%doombatc>%tempbat%temp.bat                                        
call %tempbat%temp.bat
%nolog% echo Entered for choice/Wad file: %lok%>>%doombat%doombat.log
echo Entered for choice/Wad file: %lok%
if "%lok%"=="s" goto warp
if "%lok%"=="S" goto warp
set doomwad=-file %lok%

:warp
echo.
echo *************************************************************
echo * Type in number of level to warp to or S to skip this part *
echo *************************************************************
echo.
echo Notes:
echo If you want to use nomonsters hit enter scince warp is needed to use it.
echo You'll start on the first level. With Doom 1 and Heretic seperate the
echo episode/level numbers with a space
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat

%nolog% echo Entered for choice/Warp to: %lok%>>%doombat%doombat.log
echo Entered for choice/Warp to: %lok%
if "%lok%"=="S" goto nomonsters
if "%lok%"=="s" goto nomonsters
set warp=-warp %lok%




:nomonsters
echo.
echo *****************
echo * No Monsters?  *
echo *****************
echo.
echo Y/N?
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat
%nolog% echo No monsters: %lok%>>%doombat%doombat.log
echo No Monsters: %lok%
if "%lok%"=="n" goto respawn2
if "%lok%"=="N" goto respawn2
if "%lok%"=="y" goto nomon
if "%lok%"=="Y" goto nomon
goto nomonsters
:nomon
set nomonsters=-nomonsters

:respawn2
echo.
echo *********************
echo * Respawn Monsters? *
echo *********************
echo.
echo Y/N?
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat
%nolog% echo Respawn monsters: %lok%>>%doombat%doombat.log
echo Respawn monsters: %lok%
if "%lok%"=="n" goto skill
if "%lok%"=="N" goto skill
if "%lok%"=="Y" goto respawn
if "%lok%"=="y" goto respawn
goto respawn2
:respawn

set respawn=-respawn

:skill
echo.
echo **********************************************
echo * Skill level? 1-5? Type S to skip this part *
echo **********************************************
echo.
echo.
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat

%nolog% echo Entered for choice/Skill level: %lok%>>%doombat%doombat.log
echo Entered for choice/Skill level: %lok%
if "%lok%"=="S" goto parameters
if "%lok%"=="s" goto parameters
set skill=-skill %lok%


:parameters
echo ********************************************************************
echo * Are there any extra Doom command line parameters you want to add *
echo * to your batch file? Type them in , leave blank, or hit ctrl+c to *
echo * leave this program                                               *
echo ********************************************************************
%doombatc%doombatc>%tempbat%temp.bat
call %tempbat%temp.bat
%nolog% echo Extra parameters entered were: %lok%>>%doombat%doombat.log
echo Extra parameters entered were: %lok%
set doomparam=%lok%
%nolog% echo ********************************************************>>%doombat%doombat.log

:doombat

echo This is what the command looks like 
echo %doombat1% %doomparam% %doomwad% %warp% %nomonsters% %respawn% %skill%
pause

if "%batchfile%"=="no" goto launchnb
if "%batchfile%"=="yes" goto batch
goto end
:batch
echo @echo off>>%dmbat%.bat
echo rem  ******************************************************>>%dmbat%.bat
echo rem  * This batch file was created by Mark David Bowman's *>>%dmbat%.bat 
echo rem  *    DOOMBAT program. DOOMBAT can be obtained on     *>>%dmbat%.bat
echo rem  *        FTP.CDROM.COM, and anywhere else            *>>%dmbat%.bat
echo rem  *            this program winds up at.               *>>%dmbat%.bat
echo rem  ******************************************************>>%dmbat%.bat
echo %doombat1% %doomparam% %doomwad% %warp% %nomonsters% %respawn% %skill%>>%dmbat%.bat

goto end

:launchnb
%doombat1% %doomparam% %doomwad% %warp% %nomonsters% %respawn% %skill%

:end
echo    Thank you for using Doom.bat by Mark David Bowman
