Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Tweak to AHK script needed for double window launching PC game (HOTD3)  (Read 3433 times)

0 Members and 1 Guest are viewing this topic.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
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.
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Check out this thread

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
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?
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
All you need to do is copy hod3_launcher.exe into the same folder as hod3pc.exe and launch hod3_launcher.exe instead.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Awesome. Thanks again!!  :applaud: :applaud:
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN