When the following piece of code is run in my Batch game for a fight, no matter what the input is it will always attack and go to FIGHTPROCESSORLOOP, and will tell me "Unbalanced parenthesis", while logically with an IF statement nothing should happen when the input isn't the one required, right? The "Travelling" and "Menu" codes work perfectly, so why isn't the "Fight" one working just as well?
:CHOICEPROCESSOR
set /P choice=^>
if /i "%type%"=="travel" (
if /i "%choice%"=="%choice1%" goto %TRAVELLINGPROCESSOR%
if /i "%choice%"=="%choice2%" goto %TRAVELLINGPROCESSOR%
if /i "%choice%"=="%choice3%" goto %TRAVELLINGPROCESSOR%
if /i "%choice%"=="%choice4%" goto %TRAVELLINGPROCESSOR%
if /i "%choice%"=="%choice5%" goto %TRAVELLINGPROCESSOR%
)
if /i "%type%"=="menu" (
if /i "%choice%"=="%choice1%" goto %exec1%
if /i "%choice%"=="%choice2%" goto %exec2%
if /i "%choice%"=="%choice3%" goto %exec3%
if /i "%choice%"=="%choice4%" goto %exec4%
if /i "%choice%"=="%choice5%" goto %exec5%
)
if /i "%type%"=="fight" (
if /i "%choice%"=="%weapon%" (
set /a rsdmg=!ehp!-!atk!
set /a rsedmg=!hp!-(!eatk!/!def!)
set /a ehp=!ehp!-!atk!
set /a hp=!hp!-(!eatk!/!def!)
if hp GTR bhp set hp=%bhp%
goto FIGHTPROCESSORLOOP
)
)
echo Huh?
echo.
goto CHOICEPROCESSOR
SET /A "variable=expression"
, note the"
s. See ss64.com/nt/set.html