:mydam.get
if "%special%"=="1" (
set /a mydam=60+(%random%*120/32768+1^)
) ELSE (
set /a mydam=40+(%random%*30/32768+1^)
)
The caret (^
) "escapes" the )
, telling CMD
that it's a part of the calculation, not of the IF
statement.
the
>nul
on yourset /a
statements is superfluous.try
set /a var=%random% %% %maxvalue% + 1
to roll 1..maxvaluewhy not use
set "dialogue=%~dp0Files\Dialogue"
then "%dialogue%...."