So I'm relatively new to coding, and I just can't seem to find the syntax error in this code of mine. Every time the menu loads, and I press 1, it closes and flashes a quick error saying that there is a syantax error. If you guys could help me find out what's causing the problem. BTW, this is a text based rpg. No judge :)
@echo off
TITLE VICTIMQUEST =-= RETRO EDITION
setlocal enabledelayedexpansion
:menu
color 0a
cls
echo.
echo VICTIMQUEST =-= RETRO EDITION
echo.
echo 1) Begin
echo 2) Exit
echo.
set /p c=C:\
if "%c%" == "1" goto new
if "%c%" == "2" exit
goto menu
:new
set health=100
set monsterhealth=30
set playerdmg=7
set monsterdmg=3
goto home
:home
cls
echo You sit in your nice, cozy cabin...
echo ----------------------
echo Nothing you need to worry about.
echo.
echo 1) FIGHT!
echo 2) Quit :|
echo.
set /p c=C:\
if "%c%" == "1" goto encounter1
if "%c%" == "2" goto menu
goto home
:encounter1
cls
echo You: %health%
echo.
echo 1) Attack
echo 2) Run away
echo.
set /p c=C:\
if "!c!" == "1' goto attack1
if "!c!' == "2" goto home
goto encounter1
Please help. Thanks!
@echo offline, you should see where the problem is too.) 2. Trying to write non-trivial code as a.bat/.cmdscript is asking for pain. Why don't you learn a nice scripting language like Python instead?