HELP! code not working!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Cyclops
Posts: 2
Joined: 26 Mar 2014 11:48

HELP! code not working!

#1 Post by Cyclops » 26 Mar 2014 14:39

cls
echo What type of charactor do you want to be?
echo 1) Warrior
echo 2) Archer
echo 3) Mage
echo 4) Back
set /p input=Answer?
if %input%==1 goto NEW CHARACTER BOY WARRIOR
if %input%==2 goto NEW CHARACTER BOY ARCHER
if %input%==3 goto NEW CHARACTER BOY MAGE
if %input%==0 goto NEW CHARACTER

:NEW CHARACTER BOY WARRIOR
cls
type BoyWarrior.txt
when
echo Are you sure that you want to be a male warrior?
set /p input=Answer? [Y/N]
if %input%==Y goto GAME
if %input%==y goto GAME
if %input%==N goto NEW CHARACTER BOY
if %input%==n goto NEW CHARACTER BOY
cls
echo Unknown reply!
pause
goto NEW CHARACTER BOY WARRIOR
_____________________________________
When I get to the Y/N question when i press Y,y,N,n and enter command prompt closes!
It also does this for
echo Unknown reply!
pause
goto NEW CHARACTER BOY WARRIOR
why is this and how can i fix it

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: HELP! code not working!

#2 Post by Squashman » 26 Mar 2014 14:52

When is not a valid command and I also believe you cannot use spaces with labels.

Cyclops
Posts: 2
Joined: 26 Mar 2014 11:48

Re: HELP! code not working!

#3 Post by Cyclops » 26 Mar 2014 15:34

Thanks it kind of helped. But it's working now

Post Reply