Solved Missing operand on batch

November 18, 2016 at 17:32:16
Specs: Windows 7
so i am making a game were it will subtract the monsters and persons health with its damage but its saying operand

set /a = %PersonHP% -= %MonsterDmg%
set /a = %MonsterHp% -= %PersonDmg%
if %MonsterHp% lss 0 goto Exit
if %PersonHP% lss 0 goto Exit
echo You: %PersonHP%-7
echo Monster: %MonsterHp%-7
echo 1. Attack
echo 2. Run away
set /p input=What would you like to do:

if %input% == "1" goto Attack1
if %input% == "2" goto Explore2
goto encounter1

See More: Missing operand on batch

Report •

November 19, 2016 at 05:20:34
✔ Best Answer
You generally want to avoid doing any complex logic or systems in batch scripts.
set /a PersonHP -= %MonsterDmg%
set /a MonsterHp -= %PersonDmg%

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question