Hmm,when i write check (i will explain later,why check) it takes me back to level1 but in GameSettings.ini file (ive changed it from txt to ini) is
Full code of my testing batch file
Code: Select all
@echo off
:START
echo If you have been already playing,write 1 and you will be redirected to your level
echo If you want to play again write again
set /p saved=
if %saved% ==1 goto check
if %saved% ==again goto level1
:level1
echo Write 1
set /p task=
if %task% ==1 goto level2
:level2
echo level2 >GameSettings.ini
echo Write 2
set /p task=
if %task% ==1 goto level3
:level3
echo level3 >GameSettings.ini
echo Pause
pause
:WrongLevelSpecified
echo It seems something has benn done wrong
pause
:check
FOR /F "tokens=1,2 delims==" %%I in (Gamesettings.ini) DO IF "%%I"=="level" GOTO level%%J
:hehe
pause >nul
What happens ?
I have also used
Code: Select all
set /p var= <GameSettings.ini
if %var% ==level2 goto level2
if %var% ==level3 goto level3
But it was redirecting me to level 1 too
Oh,i forgot that i needed to write 1 to go to :check,but when i write 1,it goes to :hehe (its after the :check)