Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: Louis Tully on October 24, 2014, 09:30:08 am

Title: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: Louis Tully on October 24, 2014, 09:30:08 am
.
Title: Re: Need some guidance with a batch file. Help a dummy?
Post by: lilshawn on October 24, 2014, 11:04:35 am
Quote
when I exit Mame after using the batch to launch it, there's an open cmd prompt window.

if you append an "exit" command after you run the game...

IE:

Code: [Select]
@echo off
cls
cd C:\MameUIv.138
MameUI32.exe roms\astdelux2.zip -skip_gameinfo -full_screen_brightness 1.0 -contrast 2.0 -beam 1.2 -d3dversion 9 -filter -use_bezels -throttle -waitvsync -effect ApertureHRES_j4
exit

the batch file should resume once the program ends... that means the exit command will run (since it's the next command) and kill the window.

Title: Re: Need some guidance with a batch file. Help a dummy?
Post by: rockyrocket on October 24, 2014, 12:42:55 pm
This intrigued me so I just had a quick play.
Path`s` are going to be different but for asteroids delux from AAE this Bat works for me...
Code: [Select]
@echo off
D:
CD "D:\emulators\64bit\AAE"

aae astdelux

And to start the asteroids.bat and another Batllezone plus bat via AHK hotkeys - this works....
Code: [Select]
a::
Send {Esc Down}, Send {Esc Up} ;quits aae
Sleep, 1000
Run, C:\Users\Mame seven\Desktop\AsteroidsDelux.bat
return
b::
Send {Esc Down}, Send {Esc Up} ;quits aae
Sleep, 1000
Run, C:\Users\Mame seven\Desktop\BattleZonePlus.bat
return
Not the most elegant way but it works.
This page has some good info for running bats without cmd windows popping up (http://www.tomshardware.co.uk/forum/99851-45-file-opening-window) but it may be best just to call the games directly via AHK?.
Anyway hope that helps a bit?.
Title: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: Louis Tully on October 24, 2014, 03:13:16 pm
.
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: jdbailey1206 on October 24, 2014, 03:19:09 pm
Now youre not a .bat dummy anymore.  They are neat little files once you get the hang of them. :)
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: rockyrocket on October 24, 2014, 04:27:54 pm
Sweet, get building!.
Thinking some more on this if your 3 game launch buttons were for example A,B and Shift then button combo`s can be used to shut down or reboot as well.
Code: [Select]
+A::Shutdown, 2 ;Reboot
+B::Shutdown, 1 ;Shutdown

You really would have a bare metal system then.
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: Louis Tully on October 25, 2014, 03:56:25 am
.
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: rockyrocket on October 25, 2014, 04:55:00 am
No worries, glad to help.
Put a shortcut to one of your Bat`s into your start up folder and you should just boot straight into a game and never see the desktop.

Now get building  ;D .

Edit - Glad you have no command window pop up, on my test bed (Win7-64) I do get a visable window so had to use that VBS trick linked to above.
It is messy as AHK calls a VBS that stars a Bat, but no window is seen - the VBS looks like this....
Code: [Select]
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Users\Mame seven\Desktop\AAE Bat`s\AsteroidsDelux.bat" & Chr(34), 0
Set WshShell = Nothing

And now the AHK is this...
Code: [Select]
#NoEnv
SetWorkingDir %A_ScriptDir%


a::
Send {Esc Down}, Send {Esc Up}
Sleep, 1000
Run, %A_ScriptDir%\Astdelux.vbs
return
b::
Send {Esc Down}, Send {Esc Up}
Sleep, 1000
Run, %A_ScriptDir%\BattleZonePlus.vbs
return
+A::Shutdown, 2 ;Reboot
+B::Shutdown, 1 ;Shutdown
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: Louis Tully on October 25, 2014, 05:15:58 am
.
Title: Re: [SOLVED] Need some guidance with a batch file. Help a dummy?
Post by: rockyrocket on October 25, 2014, 05:19:30 am
Looks good buddy!.
You ninja`ed a response in whilst I was editing my last post  ;D .

A funky select sound may be sweet too?
I use the attached photon sound in one of my cabs - just drop it or any other sound into the same dir as the AHK file and then use..
Code: [Select]
y::
SoundPlay, launch.mp3
Send {Esc Down}, Send {Esc Up} ;quits aae
Sleep, 1000
Run, C:\ADCabBatScripts\aaeAsteroids.bat
return

u::
SoundPlay, launch.mp3
Send {Esc Down}, Send {Esc Up} ;quits aae
Sleep, 1000
Run, C:\ADCabBatScripts\aaeAsteroidsDeluxe.bat
return

i::
SoundPlay, launch.mp3
Send {Esc Down}, Send {Esc Up} ;quits aae
Sleep, 1000
Run, C:\ADCabBatScripts\aaeArmorAttack.bat
return

You could even use a different sound for each game?.