Login Register






Help with Batch game. filter_list
Author
Message
Help with Batch game. #1
Hey guys, I'm working on a batch game to help a friend with a presentation. I decided I wanted to write a beta to a game I've had in my head called "Destroy The Drives".

The story is that you're a blackhat hacker who comes across a goldmine, the NSA gets a tip & you have to rush to destroy your evidence at your homebase. I've got some thought yet to put into it, but I'm having some trouble getting it to run how I want it. I believe my scripting all looks right, but could someone look it over?

Code:
@echo off @title Destroy The Drives :plot echo Its 7:00 AM, you haven't slept a lick. You've been up all night working another profitless project. You realize its back to your day job in 2 hours, a job you hate, but hacking just doesn't pay the bills anymore. Time to make the cofee splash your face, & get on with your day.. PAUSE echo 9:00 AM, a Monday. You arrive at your day job, almost late thanks to a compiling error you just couldn't walk away from. Here comes your boss, he knows you punched in late, better think of an excuse.. Press any key to choose your excuse. PAUSE :1st_problem echo What excuse do you give your boss? echo 1.) "I.. I'm sorry, my car was acting up, I'm really even surprised I made it. I'll be seeing a mechanic on my lunch break." echo 2.) "I wasn't late? I got here at exactl- Oh, was it daylight savings time last night?!" echo 3.) "Oh shove it up your ass." echo 4.) "I'm sorry, sir. I was working on a big project, I ran into some problems & I just coudn't walk away from it. I really hope you understand" SET /P"problem1= What excuse shall you use?" If"%problem1%"=="1" then exit If"%problem1%"=="2" then go to plot2

Its all just popping up, all the text. I want there to be periodc breaks & even when I make a selection, nothing happens. I even set option 1 to exit, & no exit, just blank. Any ideas?

Reply

RE: Help with Batch game. #2
Uhm, i havent touched batch in like a decade... but id hazard a guess that everything after echo needs to be in the quotation marks? including the x.)

and
Quote:SET /P"problem1=
looks wrong to me? id say you either need to remove the " or possibly add one to the end. a single opening quote just isnt normal lol.

Reply

RE: Help with Batch game. #3
(11-05-2013, 03:51 PM)Geoff Wrote: Uhm, i havent touched batch in like a decade... but id hazard a guess that everything after echo needs to be in the quotation marks? including the x.)

and
Quote:SET /P"problem1=
looks wrong to me? id say you either need to remove the " or possibly add one to the end. a single opening quote just isnt normal lol.

Good eye! I must have accidently deleted that entire line, it should have read;
Code:
SET /P"problem1= What's your excuse for being late?"

However.. that was not the error. ):

Reply

RE: Help with Batch game. #4
I also wonder why you use @echo off like 3-4 times? once its called i dont think its needed again unless youve turned it back on?

also wondering about the if statements. are they not case sensitive? and why wouldnt you put a space between the if keyword and the variable your checking? seems sloppy to me?

Reply

RE: Help with Batch game. #5
@Geoff think you could copy & paste into a batch file & tell me if it selecting option 1 exits, or if the "Press any key.." diaglogue appears? I feel like it may be an issue with emulating CMD.

Reply

RE: Help with Batch game. #6
(11-05-2013, 04:02 PM)Geoff Wrote: I also wonder why you use @echo off like 3-4 times? once its called i dont think its needed again unless youve turned it back on?

also wondering about the if statements. are they not case sensitive? and why wouldnt you put a space between the if keyword and the variable your checking? seems sloppy to me?

I'm about 2 minutes into the project, lol, and I used @echo off as a substitute to PAUSE as per advise I was given when emulating CMD, I'm not sure how accurate the information is, however, it did fix the original issue.

Where is there a space? There shouldn't be a space anywhere in those lines.

Reply

RE: Help with Batch game. #7
I dont think echo off works as a pause? lol. any ways i found and fixed a number of errors and the following works on my linux system under wine... so:

Code:
@echo off :plot echo Its 7:00 AM, you haven't slept a lick. You've been up all night working another profitless project. You realize its back to your day job in 2 hours, a job you hate, but hacking just doesn't pay the bills anymore. Time to make the cofee splash your face, and get on with your day.. echo 9:00 AM, a Monday. You arrive at your day job, almost late thanks to a compiling error you just couldn't walk away from. Here comes your boss, he knows you punched in late, better think of an excuse.. echo Press any key to choose your excuse. :1st_problem echo "What excuse do you give your boss?" echo 1.) "I.. I'm sorry, my car was acting up, I'm really even surprised I made it. I'll be seeing a mechanic on my lunch break." echo 2.) "I wasn't late? I got here at exactl- Oh, was it daylight savings time last night?!" echo 3.) "Oh shove it up your ass." echo 4.) "I'm sorry, sir. I was working on a big project, I ran into some problems & I just coudn't walk away from it. I really hope you understand" SET /P problem1=What's your excuse for being late? if %problem1% == 1 exit if %problem1% == 2 goto :1st_problem

Reply

RE: Help with Batch game. #8
(11-05-2013, 04:32 PM)Geoff Wrote: I dont think echo off works as a pause? lol. any ways i found and fixed a number of errors and the following works on my linux system under wine... so:

Code:
@echo off :plot echo Its 7:00 AM, you haven't slept a lick. You've been up all night working another profitless project. You realize its back to your day job in 2 hours, a job you hate, but hacking just doesn't pay the bills anymore. Time to make the cofee splash your face, and get on with your day.. echo 9:00 AM, a Monday. You arrive at your day job, almost late thanks to a compiling error you just couldn't walk away from. Here comes your boss, he knows you punched in late, better think of an excuse.. echo Press any key to choose your excuse. :1st_problem echo "What excuse do you give your boss?" echo 1.) "I.. I'm sorry, my car was acting up, I'm really even surprised I made it. I'll be seeing a mechanic on my lunch break." echo 2.) "I wasn't late? I got here at exactl- Oh, was it daylight savings time last night?!" echo 3.) "Oh shove it up your ass." echo 4.) "I'm sorry, sir. I was working on a big project, I ran into some problems & I just coudn't walk away from it. I really hope you understand" SET /P problem1=What's your excuse for being late? if %problem1% == 1 exit if %problem1% == 2 goto :1st_problem
Functioning on my end too! Thanks so much! I didn't think @echo off would substitue a pause, I'm not sure he knew too much of what he was talking about, but the problems I was getting rose some desperacy, lol.

Thanks a lot for your help, the rest is pretty much rinse & repeat for me. xD

Reply