@ECHO OFF
ECHO -------------------------------------------------------------------------
ECHO 	    Protective Guards for OpenMW - Patcher by EquiNox
ECHO -------------------------------------------------------------------------
ECHO This will create an auto patch for your chosen plugins.
ECHO 1. If you have patched manually, please exclude the plugin from the list.
ECHO 2. Make sure to put PGFOMW-Patched.esp to the bottom of load order.
ECHO 3. Listed plugins must be in the same folder as the patcher.
ECHO 4. If you are not sure what to do, read the How to Patch.txt.
ECHO -------------------------------------------------------------------------
PAUSE
ECHO Generating the patch...
tes3cmd modify --program PGFOMW.pl morrowind.esm || goto patchfail
ECHO -------------------------------------------------------------------------
ECHO Done!
ECHO PGFOMW-Patched.esp was created.
ECHO Would you like to generate a log file? (Y)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="y" goto yes
ECHO -------------------------------------------------------------------------
EXIT



:yes
tes3cmd modify -program PGFOMW.pl > PGFOMW.log
start PGFOMW.log
EXIT

:patchfail
ECHO No valid plugins detected!! 
ECHO No valid plugins detected!! 
ECHO No valid plugins detected!! 
PAUSE
EXIT