I have no idea at all how to make an "and if" statement for my batch file, and I hope I could get some help in here.
The line I'm trying to make:
if %a%==X/O and if %b%==X/O goto done
In batch, if statements are quite simple, but unfortunately don't have the same amount of functionality of many other coding languages such as JavaScript.
In batch, to write an if statement, there are only 4 parts. Of course at the beginning you have to specify that it is a if statement, then you add the two things you will be comparing, and the operator. Once that is done, you specify the function you want the program to do if the condition is true. For example:
if "%type%" == "5" goto end
Also, one last thing to note. If your condition is false, the batch file will simply go to the next line. So you might want to add something like this:
:start
set num1=1
set num2=2
set num3=3
set /a totalnum=%num1%+%num2%+%num3%
if "%totalnum%" == "100" goto end
goto start
:end
exit
Batch doesn't have support for ands or ors in if logic. You can simulate an and by nesting your conditions.
if %a%==X/O (
if %b%==X/O (
goto done
)
)
Similarly, you can simulate an or by having two separate checks.
if %a%==X/O goto done
if %b%==X/O goto done
X/O.
and... moreover I recommend to put all expressions left and right from the==in between""to avoid trouble with empty variables...