1.

Solve : Batch game help?

Answer»

I'm working on a batch came thats manly text like say:

You come to a wall there is a small came
go through the cave? =a
go back =b

only its based on Halo but I cant get it to WORK

Code: [Select]@echo off
echo Halo: Combat Evolved
echo.
echo *******************************************************************************
echo.
echo.
echo o##o ."";. .'@%; .,0000O'. .;'"Oo""oOOO%";.
echo ##o .###" .""O##%; '000O 'o;. .;O#@"
echo ###@OOOOOO###" ,;"[emailprotected]###O, '000O oO. ,O;. ,###';
echo ###O .###" ,o##%, "@##o, '000O . .;"@#@o
echo "@##@", ."o '[emailprotected]#@O; ,%@##";, ;"00000000000 ;oOoOO%@#@%o'.
echo.
echo.
echo The Low RAM version
echo Bungi Gearbox Microsoft Comsi
echo.
echo Game Set to "easy"
set /p co="player code=""
if co= new goto: new

:new
cls
echo.
echo __________________________________________
echo / \
echo / \
echo | |
echo |----------------------------------------------|
echo | |
echo | |
echo | |
echo | |
echo |______________________________________________|
echo |________________________________________ |
echo | | |
echo \ | |
echo \ | |
echo | | |
echo | | |
echo | | |
echo /______________________________________| |
echo /_____________________________________________|
echo |\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
echo |----------------------------------------------|
echo | |
echo | |
echo |______________________________________________|
echo | |
echo \ ______ /
echo \ \ / /
echo | \ / |
echo | \/ |
echo |_________________________________________|
echo
echo you come to a hall way, go wich way? L or R
set /p co=" "
if co= R goto 2
if co= L goto 3

:2
cls
echo ________________________________________________
echo | |
echo / \
echo / \
echo/ \
echo| |
echo| ______________________ |
echo| / \ |
echo| | | |
echo| | | |
echo| | | |
echo| | | |
echo| | | |
echo| | | |
echo| | | |
echo|___ | | |
echo|____ \ \ / ____|
echo| \ \________________________________________ / |
echo| \_________________________________________/ |
echo| |
echo| |
echo \ /
echo \ /
echo \________________________________________________/
echo you come to a branch, go across or keep going down the hall? K or T
set /p co="k= keep going T go through"
if co= k goto 4
if co= T goto 5

:3
cls
echo ______________________________________________________
echo | |
echo | |\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\| |
echo | | | | | | |
echo | / | | | \ |
echo | / | | | \ |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | / / | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | \ \ | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | \ | | | / |
echo | \ | | | / |
echo |_______________________________________________________
echo door locked press any key to go back
Pause
goto new

:4
cls
echo ______________________________________________________
echo | |
echo | |\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\| |
echo | | | | | | |
echo | / | | | \ |
echo | / | | | \ |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | / / | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | \ \ | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | | | | | | |
echo | \ | | | / |
echo | \ | | | / |
echo |_______________________________________________________
echo door locked press any key to go back
Pause
goto 2
Here what I got.
(I have vista)
COPY it to notepad it looks better.Quote

if co= new goto: new

variables have percent signs around them when you want to use their values

you use quotes in if tests

and double equals signs

you don't use the colon when using the label in a goto

if "%co%"=="new" goto new
It still dosent work I dont know why.
It's all those....vertical lines. (I've forgotten what they're called).

You cannot simply have '|'. It needs to be '^|'

Try it for yourself.

Go to Command Prompt and type 'echo |' and press Enter
Then type 'echo ^|' and press Enter.Pipes.Oh, pipes? Really? Ok.Yes pipes. What's the problem with that?

here is the output of of type being piped (twice) to find:

type animal.txt | find "lion" | find /v "sealion"

Quote from: Dias de VERANO on December 12, 2008, 12:17:20 AM
Yes pipes. What's the problem with that?



What's wrong with the pipes? They're not leaking, are they?Yes, the '|'s are the problem, and yes they are pipes, and no they are not leaky. or as some disallusioned players of mario BROTHERS will try to contend, as they do on the game, that they are not "pipes" but rather "tubes"... a somewhat odd theory that will still officially correct is only so because of the basic tenement that a pipe is, by definition, a metal tube. However, calling the mario brothers pipes "tubes" is like calling a pop can a "pop cylinder".

That was weird; it went from the pipe character to a rant about the misuse of the word tube in mario brothers vernacular. Oh well.


Discussion

No Comment Found