Using the pause command I found that the error is in the first line of this code:
if %choice% == 1 if %energy% => %m2enc% set /a enemhp=%enemhp%-%m1hpd%+%earmr%
pause
set /a energy= %energy%-%m1enc%
set /a hp= %hp%-%edefense%
set /a defense= %defense%+1
goto battle
So don't say that I forgot to set the energy and the m2enc, because I did just in a different section, I also tried replacing %energy%
with 10
and m2enc%
with 1
and it still didn't work, I tried replacing the =>
with >=
and with LSQ
(apparently an alternative for less than or equal too) So I would like to know whats wrong with this part.
The notation a ≤ b or a ⩽ b means that a is less than or equal to b (or, equivalently, at most b, or not greater than b). The notation a ≥ b or a ⩾ b means that a is greater than or equal to b (or, equivalently, at least b, or not less than b).
The greater than or equal to symbol is used to represent inequality in math. It tells us that the given variable is either greater than or equal to a particular value. For example, if x ≥ 3 is given, it means that x is either greater than or equal to 3.
Press and hold the Alt key and type 243 on your keypad.
In batch, the >
is a redirection sign used to output data into a text file. The compare op's available (And recommended) for cmd are below (quoted from the if /?
help):
where compare-op may be one of: EQU - equal NEQ - not equal LSS - less than LEQ - less than or equal GTR - greater than GEQ - greater than or equal
That should explain what you want. The only other compare-op is ==
which can be switched with the if not
parameter. Other then that rely on these three letter ones.
There is no =>
for if.
Use if %energy% GEQ %m2enc%
See if /?
for some other details.
You can use:
EQU - equal
NEQ - not equal
LSS - less than
LEQ - less than or equal
GTR - greater than
GEQ - greater than or equal
AVOID USING:
() ! ~ - * / % + - << >> & | = *= /= %= += -= &= ^= |= <<= >>=
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With