1.

Solve : I've been trying to get My batch file game to work but it isn't Please help?

Answer»

I want it to be knda an old fashioned multiple path game
where you choose different paths for different things to happen (sorry bad explaination)

anyway here it is :

@echo off
cls
echo Today you will begin you Quest...
echo.
pause
cls
echo The quest to find...
echo.
pause
cls
echo THE ULTIMATE CUPCAKE!!!
echo.
pause
cls
echo Not only is it the best tasting cupcake in the world but
echo it will also grant you the power to...
echo.
pause
cls
echo BECOME INVISIBLE!!! (for 3-11 seconds)
echo.
pause
cls
echo Do you want to Begin? Y or N
set /p co="% %"
if "%co%"=="Y" goto 2
if "%co%"=="N" goto end

2:
cls
echo you wake up in a musty, dark, dank cave
echo you dont know how you got there
echo you feel as though someone is close to you
echo watching you...
echo.
pause
cls
echo Do you A Run to the Exit or B Pull out your Dagger? A or B
set /p co="% %"
if "%co%"=="A" goto R
if "%co%"=="B" goto D

D:
cls
echo You reach for your dagger
echo but in place of where you dagger should be
echo is some thing fleshy
echo.
pause

end:
cls
echo You Lost
echo.
pause

R:
echo You MAKE a mad dash for the exit of the cave
echo but as you head into the sunlight and out of
echo the darkness, you look back for a second
echo and notice something glimmer inside of the cave.
echo.
cls
echo Do you A Go back inside or B Start trying to find your way home? A or B
set /p co="% %"
if "%co%"=="A" goto H
if "%co%"=="B" goto B

H:
echo You look at your surrounding horizon
echo hoping to see a sign of civilization
echo you decide just to start walking
echo.
pause
cls
echo Do you A Head North or B Head East? A or B
set /p co="% %"
if "%co%"=="A" goto N
if "%co%"=="B" goto E

N:
echo You start walking North
echo after walking for about 5 hours
echo it starts to get dark
echo then suddenly you fall into a deep pit
echo.
pause
goto end


all help will be appreciated


So, what's going wrong with your FILE?TRY THIS
Code: [Select]@echo off

cls
echo Today you will begin you Quest...
echo.
pause
cls
echo The quest to find...
echo.
pause
cls
echo THE ULTIMATE CUPCAKE!!!
echo.
pause
cls
echo Not only is it the best tasting cupcake in the world but
echo it will also grant you the power to...
echo.
pause
cls
echo BECOME INVISIBLE!!! (for 3-11 seconds)
echo.
pause

cls
echo Do you want to Begin?
set co=
set /p co=Y or N:
if %co% equ Y goto 2
if %co% equ N goto end
if %co% equ y goto 2
if %co% equ n goto end

:2
cls
echo you wake up in a musty, dark, dank cave
echo you dont know how you got there
echo you feel as though someone is close to you
echo watching you...
echo.
pause
cls
echo Do you A Run to the Exit or B Pull out your Dagger?
set co=
set /p co=A or B:
if %co% equ A goto R
if %co% equ B goto D
if %co% equ a goto R
if %co% equ b goto D

:D
cls
echo You reach for your dagger
echo but in place of where you dagger should be
echo is some thing fleshy
echo.
pause

:end
cls
echo You Lost
echo.
pause
exit

:R
cls
echo You make a mad dash for the exit of the cave
echo but as you head into the sunlight and out of
echo the darkness, you look back for a second
echo and notice something glimmer inside of the cave.
cls
echo Do you A Go back inside or B Start trying to find your way home?
set co=
set /p co=A or B:
if %co% equ A goto H
if %co% equ B goto B
if %co% equ a goto H
if %co% equ b goto B

:H
cls
echo You look at your surrounding horizon
echo hoping to see a sign of civilization
echo you decide just to start walking
echo.
pause
cls
echo Do you A Head North or B Head East?
set co=
set /p co=A or B:
if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto E

:N
cls
echo You start walking North
echo after walking for about 5 hours
echo it starts to get dark
echo then suddenly you fall into a deep pit
echo.
pause
goto endWhere is E supposed to take you in this part
Code: [Select]:H
cls
echo You look at your surrounding horizon
echo hoping to see a sign of civilization
echo you decide just to start walking
echo.
pause
cls
echo Do you A Head North or B Head East?
set co=
set /p co=A or B:
if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto EThnx I'll try it stalor Yeah thnx stalor i got it now i'll post the game when i'm finished (probably in about a week)Quote from: stalor214 on January 27, 2009, 08:13:13 PM

TRY THIS
Code: [Select]echo Do you A Head North or B Head East?
set co=
set /p co=A or B:
if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto E

Why not use the /I in the IF statements? /I makes it case it so it ignores case and thus you could use
Code: [Select]if /I %co% equ a goto N
if /I %co% equ b goto E

Which should still get you the same results as
Code: [Select]if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto ESorry didnt think about that i was tired@echo off

cls
echo Today you will begin you Quest
echo The quest to find
echo The Ultimate Cupcake
echo Not only is it the best tasting cupcake in the world but
echo It will also grant you the power to
echo Become invisible (for 3-11 seconds)
echo.
pause

cls
echo Do you want to Begin?
set co=
set /p co=Y or N:
if %co% equ Y goto 2
if %co% equ N goto end
if %co% equ y goto 2
if %co% equ n goto end

:2
cls
echo you wake up in a musty, dark, dank cave
echo you dont know how you got there
echo you feel as though someone is close to you
echo watching you...
echo.
pause
cls
echo Do you A Run to the Exit or B Pull out your Dagger?
set co=
set /p co=A or B:
if %co% equ A goto R
if %co% equ B goto D
if %co% equ a goto R
if %co% equ b goto D


cls
echo You reach for your dagger
echo but in place of where you dagger should be
echo is some thing fleshy
echo It is a hand it grips you by the nape
echo Of your neck and hits you head against
echo The cave wall.
pause
goto end

:R
cls
echo You make a mad dash for the exit of the cave
echo but as you head into the sunlight and out of
echo the darkness, you look back for a second
echo and notice something glimmer inside of the cave.
echo.
pause
cls
echo Do you A Go back inside or B Start trying to find your way home?
set co=
set /p co=A or B:
if %co% equ A goto B
if %co% equ B goto H
if %co% equ a goto B
if %co% equ b goto H

:H
cls
echo You look at your surrounding horizon
echo Hoping to see a sign of civilization
echo You decide just to start walking
echo.
pause
cls
echo Do you A Head North or B Head East?
set co=
set /p co=A or B:
if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto E

:N
cls
echo You start walking North,
echo After walking for about 5 hours
echo It starts to get dark
echo Then suddenly you fall into a deep pit
echo.
pause
goto end

:B
cls
echo You slowly walk back inside
echo As you continue walking you see
echo The glimmer again
echo You slowly creep towards it
echo As you get closer you hear
echo Breathing.
echo.
pause
echo Do you A Run out of the cave or B stand still?
set co=
set /p co=A or B:
if %co% equ A goto R
if %co% equ B goto S1
if %co% equ a goto R
if %co% equ b goto S1

:S1
cls
echo You continue walking for many hours until
echo You think you can see your Hut on the horizon
echo You start running
echo As you enter the hut you realize it isn't yours
echo And the inhabitants of the hut don't seem
echo Friendly.
echo.
pause
goto end


:E
cls
echo You head East for about 4 hours
echo You can see that it is starting to get dark
echo.
pause
cls
echo Do you A Setup camp or B Continue walking?
set co=
set /p co=A or B:
if %co% equ A goto R
if %co% equ B goto S1
if %co% equ a goto R
if %co% equ b goto S1
echo

:R
cls
echo You find a nice shaded spot in the trees
echo You build a tepee type house
echo Out of dead branches
echo And spanish moss for insulation.
echo You finish your temporary home
echo Just in time it has become completely
echo Dark you crawly into your tepee and go to
echo Sleep.
echo ...
echo ...
echo You wake up fealing refreshed
echo.
pause
cls
echo Do you A Look for food or B Continue walking?
set co=
set /p co=A or B:
if %co% equ A goto F1
if %co% equ B goto B1
if %co% equ a goto F1
if %co% equ b goto B1
echo

:B1
cls
echo Do you A Go East or B Go West?
set co=
set /p co=A or B:
if %co% equ A goto S1
if %co% equ B goto B3
if %co% equ a goto S1
if %co% equ b goto B3
echo

:B3
cls
echo You continue walking Westward
echo You come across a Castle
echo It has Large life-like stone
echo GARGOYLES gaurding it
echo.
pause
cls
echo Do you A Go Inside or B Continue walking Westward?
set co=
set /p co=A or B:
if %co% equ A goto Win
if %co% equ B goto S1
if %co% equ a goto Win
if %co% equ b goto S1
echo

:Win
cls
echo You walk inside and see the
echo Ultimate Cupcake on a pedistool
echo You eat it!
echo.
pause
goto Y

:Y
cls
echo You Won!!!
echo.
pause
exit

:end
cls
echo You Lost
echo.
pause
exit

:F1
cls
echo As you go looking for food
echo You stumble upon a chest
echo As you open it you see a cupcake
echo "Could it bee the Ultimate Cupcake?"
echo You pick it up and see a sign on it
echo It says "Poison" surely a hoax
echo To keep people from eating it
echo You take a bite out of it.
echo.
pause
goto endGRATZ final refined VERSION:

color d
@echo off

REM"THE QUEST FOR THE ULTIMATE CUPCAKE"
CREATED BY: EMMANUEL LYKES
ALL RIGHTS RESERVED (NOT REALLY)

cls
echo Today you will begin your Quest
echo The quest to find
echo The Ultimate Cupcake
echo Not only is it the best tasting cupcake in the world but
echo It will also grant you the power to
echo Become invisible (Side effects may include death,
echo Explosion of bladder, loss of toes and/or fingers,
echo And sudden cravings for Maple Syrup)
echo.
pause

cls
echo Do you want to Begin?
set co=
set /p co=Y or N:
if %co% equ Y goto 2
if %co% equ N goto end
if %co% equ y goto 2
if %co% equ n goto end

:2
color d
cls
echo You wake up in a musty, dark, dank cave
echo You dont know how you got there
echo You feel as though someone is close to you
echo Watching you "Maybe it's that creepy
echo Girl at school who's been stalking me"
echo You think to yourself.
echo.
pause
cls
color d
echo Do you A Run to the Exit or B Pull out your Prison shank ?
set co=
set /p co=A or B:
if %co% equ A goto R1
if %co% equ B goto D
if %co% equ a goto R1
if %co% equ b goto D


cls
color d
echo You reach for your shank
echo But in place of where "Ol' shanky" should be
echo Is something furry,
echo It is the paw of the Crazy Giant Vampire Rabbit
echo It grips you by the nape
echo Of your neck and hits you head against
echo The cave wall.
echo You are the Rabbit's next meal
echo.
pause
goto end

:R1
cls
color d
echo You make a mad dash for the exit of the cave
echo But as you head into the sunlight and out of
echo The darkness, you look back for a second
echo And notice something move inside of the cave.
echo.
pause
cls
color d
echo Do you A Go back inside or B Start trying to find your way home?
set co=
set /p co=A or B:
if %co% equ A goto B
if %co% equ B goto H
if %co% equ a goto B
if %co% equ b goto H

:H
cls
color d
echo You look at your surrounding horizon
echo Hoping to see a sign of civilization
echo You decide just to start walking
echo.
pause
cls
color d
echo Do you A Head North or B Head East?
set co=
set /p co=A or B:
if %co% equ A goto N
if %co% equ B goto E
if %co% equ a goto N
if %co% equ b goto E

:N
cls
color d
echo You start walking North,
echo After walking for about 5 hours
echo It starts to get dark
echo Then suddenly you fall into a deep pit
echo Filled with steak so Sweet and
echo Savory you can't Help but eat them.
echo After about 46 (and a half) steaks you
echo Die of a heart-attack
echo.
pause
goto end

:B
cls
color d
echo You slowly walk back inside
echo As you continue walking you see
echo Something move again
echo You slowly creep TOWARD it
echo As you get closer you hear
echo Breathing.
echo.
pause
cls
color d
echo Do you A Run out of the cave or B Stand still?
set co=
set /p co=A or B:
if %co% equ A goto R1
if %co% equ B goto S2
if %co% equ a goto R1
if %co% equ b goto S2

:S1
cls
color d
echo You continue walking for many hours until
echo You think you can see your Hut on the horizon
echo You start running
echo As you enter the hut you realize it isn't yours
echo And the inhabitants (escaped Oompa Loompas)
echo Of the hut don't seem friendly
echo They violently shuv 23 pounds of fudge down you throat
echo Then they roast you and feed you to thier pet gummi bear.
echo.
pause
goto end


:E
cls
color d
echo You head East for about 4 hours
echo You can see that it is starting to get dark
echo.
pause
cls
color d
echo Do you A Setup camp or B Continue walking?
set co=
set /p co=A or B:
if %co% equ A goto R
if %co% equ B goto S1
if %co% equ a goto R
if %co% equ b goto S1
echo

:R
cls
color d
echo You find a nice shaded spot in the trees
echo You build a tepee type house
echo Out of dead branches
echo And old YMCA pamphlets for insulation.
echo You finish your temporary home
echo Just in time, it has become completely
echo Dark you crawl into your tepee and go to
echo Sleep.
echo ...
echo ...zzz
echo ...
echo You wake up feeling refreshed
echo.
pause
cls
color d
echo Do you A Look for food or B Continue walking?
set co=
set /p co=A or B:
if %co% equ A goto F1
if %co% equ B goto B1
if %co% equ a goto F1
if %co% equ b goto B1
echo

:B1
cls
color d
echo Do you A Go East or B Go West?
set co=
set /p co=A or B:
if %co% equ A goto S1
if %co% equ B goto B3
if %co% equ a goto S1
if %co% equ b goto B3
echo

:B3
cls
color d
echo You start walking Westward
echo You come across a castle shaped like
echo A giant Pikachu
echo.
pause
cls
color d
echo Do you A Go Inside or B Continue walking Westward?
set co=
set /p co=A or B:
if %co% equ A goto Win
if %co% equ B goto S1
if %co% equ a goto Win
if %co% equ b goto S1
echo

:Win
cls
color d
echo You walk inside and see the
echo Ultimate Cupcake on a pedistool
echo You eat it!
echo.
pause
goto Y

:Y
color a
cls
echo YOU WON!!!
echo.
pause
exit

:end
color c
cls
echo You Lost
echo.
pause
exit

:F1
cls
color d
echo As you go looking for food
echo You stumble upon a chest
echo As you open it you see a cupcake
echo "Could it be the Ultimate Cupcake?"
echo You pick it up and see a sign on it
echo It says "MADE OUT OF CRACK IF
echo YOU SNORT IT YOU WILL O.D." surely a hoax
echo To keep people from snorting it
echo You happily snort it up!
echo.
pause
goto end

:S2
cls
color d
echo You stand still hoping that whatever was breathing
echo Went away
echo You hear a loud crack behind you
echo "Oh no it's Brittany Spears armed with
echo A baby" She hits you repeatedly on the head with
echo The baby until you are dead.
echo.
pause
goto end


Discussion

No Comment Found