The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: Wade007 on July 13, 2012, 10:46:21 am
-
I'm launching House of the Dead III (PC Port) on my game cabinet via AHK & Mala but have run into a small scripting snag. Looking for advice and tweak input here. My guess is it's an easy fix, but I'm an AHK novice. :dunno
House of the Dead III will only start after a PC launch window is opened first. Once the "Play Game" is selected in the launch window, this window closes and then a new window opens full screen which is the actual game. Select "Start Game" again and you're off... So, two windows to play the game.
No big deal, but the problem is my AHK script has a hard time knowing when to shut itself down if at any point the user decides to NOT launch the game AFTER the launch window has opened but BEFORE selecting 'Play Game' to launch the next window. I'd like to code my AHK script to shut itself down when and if either of the two windows (both titled 'THE HOUSE OF THE DEAD 3') gets shut down by the user selecting EXIT or clicking the top right red Windows 'X' Symbol.
Below is my mostly working script. It's set up to handle the two game windows when opened in succession, but not if the first one closes and the second one never gets opened. I need AHK to shut itself down IF the first window is the only one that ever gets opened and the game is NOT played. I guess is that there's some sort of "ifWinActive" type command needed but I'm lost. ???
#SingleInstance force
SetWorkingDir, C:\Arcade\PC Arcade Ports\
Run, C:\Arcade\PC Arcade Ports\THE HOUSE OF THE DEAD3_EU\hod3launch.exe
WinWait, THE HOUSE OF THE DEAD 3 ;Launch Window
WinWaitClose, THE HOUSE OF THE DEAD 3 ; Launch window closes to play game, but what if it was just quit out of directly?
WinWait, THE HOUSE OF THE DEAD 3 ; Game window opens (same title)
WinWaitClose, THE HOUSE OF THE DEAD 3 ; Game window closes
exitAPP ; script will close AHK here ONLY if there were TWO windows opened in succession.
; If only one opened (Launch Window), the script won't make it this far and
; AHK will still run in the background. How to fix?
LCtrl::~LButton
LAlt::~RButton
Space::~Enter
c::~ESC
a::~LButton
s::~RButton
q::~Enter
]::~ESC
~2 & ~4::
Process, Close, hod3pc.exe
ExitAPP
return
Thanks for any help you can offer.
-
Check out this thread (http://forum.arcadecontrols.com/index.php?topic=63745.0)
-
headkaze,
Thanks for your reply.
Circumventing the launcher outright is a much better solution. I didn't think it was possible. I'll test out these scripts and/or your new launcher to see if it can work for me.
Do you suggest using your "hod3_launcher.exe" file for the script set written by Cananas?
Does your launcher program just replace the current one? Write over?
-
All you need to do is copy hod3_launcher.exe into the same folder as hod3pc.exe and launch hod3_launcher.exe instead.
-
Awesome. Thanks again!! :applaud: :applaud: