Johnny T Posted September 6 Share Posted September 6 Hi all I'm trying to launch ChaseHQ from an AHK file so that I can have MameHooker running instead of LEDBlinky. I've tried lots of different variants but I'm getting nowhere and wondered if someone could help? Here's where I'm up to... #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance force SetWorkingDir, "D:\LaunchBox Arcade\Emulators\MAME\MAME Arcade" ;where mame is located. Note: No "\" after "Mame". MAMERun = mame.exe GameRDP = "D:\LaunchBox Arcade\Games\Arcade\chasehq.zip" ;Path and Machine (rom) folder Process,Close,LEDBlinky.exe Run,taskkill /im "LEDBlinky.exe" /F Sleep 2500 Process,Close,mamehook.exe Run,taskkill /im "mamehook.exe" /F Sleep 2500 Run, "D:\LaunchBox Arcade\Emulators\MameHooker\mamehooker5.1\mamehook.exe" Sleep 2500 Run, %MAMERun% -"D:\LaunchBox Arcade\Games\Arcade\chasehq.zip", , Hide Escape:: Process,Close,mamehook.exe Run,taskkill /im "mamehook.exe" /F Sleep 300 Process,Close,mame.exe Run,taskkill /im "mame.exe" /F WinClose, ahk_exe mame.exe Sleep 300 Run, "D:\LaunchBox Arcade\LEDBlinky\LEDBlinky.exe" return I just get an error when it comes to launching MAME ? Quote Link to comment Share on other sites More sharing options...
Solution JoeViking245 Posted September 6 Solution Share Posted September 6 39 minutes ago, Johnny T said: I just get an error when it comes to launching MAME ? You have an extra - (dash) right before the "path\to\ROM.zip". Remove it. Run, %MAMERun% -"D:\LaunchBox Arcade\Games\Arcade\chasehq.zip", , Hide Run, %MAMERun% "D:\LaunchBox Arcade\Games\Arcade\chasehq.zip", , Hide ; OR Run, %MAMERun% "%GameRDP%", , Hide Quote Link to comment Share on other sites More sharing options...
Johnny T Posted September 7 Author Share Posted September 7 (edited) Thanks @JoeViking245 you cracked it! I thought I still had an error but with a bit more experimentation it's now working. You were right with your fix but I also had an issue with quotation marks around the SetWorkingDir variable that I didn't need. So my full script is now: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance force SetWorkingDir, D:\LaunchBox Arcade\Emulators\MAME\MAME Arcade ;where mame is located. Note: No "\" after "Mame". MAMERun = mame.exe GameRDP = D:\LaunchBox Arcade\Games\Arcade\chasehq.zip ;Path and Machine (rom) folder Process,Close,LEDBlinky.exe Run,taskkill /im "LEDBlinky.exe" /F Sleep 2500 Process,Close,mamehook.exe Run,taskkill /im "mamehook.exe" /F Sleep 2500 Run, "D:\LaunchBox Arcade\Emulators\MameHooker\mamehooker5.1\mamehook.exe" Sleep 2500 Run, %MAMERun% "%GameRDP%", , Hide Escape:: Process,Close,mamehook.exe Run,taskkill /im "mamehook.exe" /F Sleep 300 Process,Close,mame.exe Run,taskkill /im "mame.exe" /F WinClose, ahk_exe mame.exe Sleep 300 Run, "D:\LaunchBox Arcade\LEDBlinky\LEDBlinky.exe" return This is working perfectly - thanks very much for your help! Let's go Mr Driver......... Edited September 7 by Johnny T 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.