Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: shardian on February 06, 2009, 01:01:58 pm

Title: Making a looping batch file
Post by: shardian on February 06, 2009, 01:01:58 pm
Here is the deal:

I want to have a batch file that gives me a list of about 8 games. The first one opens by activating the batch file. When P1+P2 is hit, it exits and the next game loads up.  I want an endless cycle of this. How do I write that in a batch file?
Title: Re: Making a looping batch file
Post by: SavannahLion on February 06, 2009, 01:12:24 pm
Use a GOTO

For example
Quote
:BEGINNING
Do your thing here
goto BEGINNING

Keep in mind this is an endless loop. You might need to build an :DONE and an IF statement to search for an escape.
Title: Re: Making a looping batch file
Post by: shardian on February 06, 2009, 01:21:40 pm
Well for this weekend I'm using my good desktop PC as a temp setup. I'll just get to the desktop and cancel the msdos window. The final setup will be in DOS, so I'll just shut her down without messing with it.
Title: Re: Making a looping batch file
Post by: shardian on February 06, 2009, 01:48:37 pm
Wow, that was fun! It looped alright...to infinity and beyond! Now can someone help me figure out how to add a pause between each command? I don't mean a PAUSE command (hit space to continue), but a command that would start the next command as soon as I exit the first program. I assume I would have to monitor the status of MAME running or something, right?
Title: Re: Making a looping batch file
Post by: patrickl on February 06, 2009, 02:18:50 pm
You could use the start command with a wait switch. Like:

start /wait notepad.exe
Title: Re: Making a looping batch file
Post by: shardian on February 06, 2009, 03:01:30 pm
Adding /wait in there worked like a charm. Sweet!

To be safe, I also threw in a pause function. Last thing I need is to have the boss walk in while I'm frantically trying to shut down a rampant arcade program.  :dizzy:
Title: Re: Making a looping batch file
Post by: patrickl on February 06, 2009, 04:25:41 pm
I loved how old games sometimes had a "boss screen'". By that I don't mean a boss level, but you'd press F10 or something and some spreadsheet would appear while the game paused.
Title: Re: Making a looping batch file
Post by: CheffoJeffo on February 06, 2009, 05:08:41 pm
(http://upload.wikimedia.org/wikipedia/en/3/3e/Leisure_Suit_Larry_Bosskey.png)

 :applaud:
Title: Re: Making a looping batch file
Post by: patrickl on February 06, 2009, 05:15:10 pm
You're so going to get in trouble with that avatar. Don't mess with the Xohan!

BTW did you have any luck with that ad?
Title: Re: Making a looping batch file
Post by: Ginsu Victim on February 06, 2009, 05:15:51 pm
So you just settled for the first one that popped up on google? ;)

I was trying to find one of the fake spreadsheet ones.
Title: Re: Making a looping batch file
Post by: CheffoJeffo on February 06, 2009, 05:18:58 pm
LSL is a classic and was the only game that I ever used the Boss Key on, hence the mention here.

What's wrong with my avatar ? Has it been cross-linked again ? I'd better look into getting that fixed !

EDIT: OK, Gins, THAT is right over the top. What's the over/under on how long that stays there ?