as the title says, my batch script is not working, all i know that this error happens after "REM BUCKS", also i saw the text "0 was unexpected at this time." before quitting, can you guys see what is the problem?and maybe provide a solution?i need this code for my game.
This script is a scoring script, i simulate it by adding the "SETs"
Under the "REM SCORE" will set the earn to 0 if the earn variable is a negative.
I cannot give you the full script beacuse its so huge
here is the code:
SETLOCAL
set stage=add
set r=10
set dif=3
set timer=30
set w=2
set cash=6
REM BUCKS
if %stage%==cha (
set st=10
REM SCORE
call :calculator %r%*10*%dif%*%st%-%w%*%timer%
timeout 5 > NUL
set earn=%val%
if %earn% LSS 0 set earn=0
set /a cash=%cash% + %val%
goto :EOF
)
if %stage%==0 goto :EOF
if %stage%==add set st=3
if %stage%==sub set st=4
if %stage%==mul set st=5
call :calculator %r%*10*%dif%*%st%-(%timer%*%w%)
set earn=%val%
if %earn% LSS 0 (
set earn=0
)
set /a cash=%cash% + %val%
pause
exit
goto :EOF
:calculator
>"%temp%\VBS.vbs" echo Set fso = CreateObject("Scripting.FileSystemObject") : Wscript.echo (%*)
for /f "delims=" %%a in ('cscript /nologo "%temp%\VBS.vbs"') do set "val=%%a"
del "%temp%\VBS.vbs"
goto :EOF
thx for reading