Aevans0001 Posted September 28, 2019 Share Posted September 28, 2019 So I just moved my installation of everything over to a new computer and everything was going good until I noticed my ahk wasn't working on commodore 64. @Jason Carr was there anything done to running ahk from the emulators settings lately? So what I am trying to do is run joytokey.exe with a particular profile before I run winvice, and then closing joytokey upon exit of winvice. This used to work, however now I can not get it to. My current ahk script reads this Run, "C:\games\joytokey\joytokey.exe" WinWait, ahk_exe x64.exe WinWaitClose ; Wait for the exact window found by WinWait to be closed. Run, "C:\games\joytokey\joytokeykill.bat" everything seems to work except the joytokeykill.bat does not run. Also you may notice that Joytokey.exe does not run a particular profile. I would love it to choose just a profile, but when I set it up I could not get it to work, so any help there would be great also. My file JoytoKeykill.bat does work if I manually load it. Quote Link to comment Share on other sites More sharing options...
Undertherainbow Posted September 29, 2019 Share Posted September 29, 2019 (edited) u should replace joytokeykill.bat with something like this: start "" /WAIT "somegame.exe" Timeout 1 taskkill /f /im JoyToKey.exe By using start WAIT, "somegame.exe" can be name of emulator or.. most easiest maybe would be to put all on escape? $Esc:: { Process, Close, joytokill.exe } or u can use if WinExist("ahk_exe someprogram.exe") DO.. @Aevans0001 P.S just remembered , there is also little hard way to check if process is active then Do.. TIMEOUT /T 3 :while1 FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %GAMENAME%"') DO IF %%x == %GAMENAME% goto FOUND goto FIN :FOUND TIMEOUT /T 5 goto :while1 :FIN taskkill /f /im joytokill.exe define emulator as %GAMENAME% set "GAMENAME=someprogram.exe" Anyway there are bunch of choices to deal with it Edited September 29, 2019 by Undertherainbow Quote Link to comment Share on other sites More sharing options...
Aevans0001 Posted September 29, 2019 Author Share Posted September 29, 2019 5 hours ago, Undertherainbow said: u should replace joytokeykill.bat with something like this: start "" /WAIT "somegame.exe" Timeout 1 taskkill /f /im JoyToKey.exe By using start WAIT, "somegame.exe" can be name of emulator or.. most easiest maybe would be to put all on escape? $Esc:: { Process, Close, joytokill.exe } or u can use if WinExist("ahk_exe someprogram.exe") DO.. @Aevans0001 P.S just remembered , there is also little hard way to check if process is active then Do.. TIMEOUT /T 3 :while1 FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %GAMENAME%"') DO IF %%x == %GAMENAME% goto FOUND goto FIN :FOUND TIMEOUT /T 5 goto :while1 :FIN taskkill /f /im joytokill.exe define emulator as %GAMENAME% set "GAMENAME=someprogram.exe" Anyway there are bunch of choices to deal with it how do I define the emulator and game name? I am running this for every game in c64. Quote Link to comment Share on other sites More sharing options...
Undertherainbow Posted September 29, 2019 Share Posted September 29, 2019 just use something like this to close joytokey and emulator in same time $Esc:: { Process, Close, {{{StartupEXE}}} Process, Close, joytokill.exe } Quote Link to comment Share on other sites More sharing options...
Aevans0001 Posted September 29, 2019 Author Share Posted September 29, 2019 Sorry, I am completely confused now.. Do i put the whole thing in? TIMEOUT /T 3 :while1 FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %GAMENAME%"') DO IF %%x == %GAMENAME% goto FOUND goto FIN :FOUND TIMEOUT /T 5 goto :while1 :FIN taskkill /f /im joytokill.exe $Esc:: { Process, Close, {{{StartupEXE}}} Process, Close, joytokill.exe } define emulator as %GAMENAME% set "GAMENAME=someprogram.exe" like that, or are you saying just do this now $Esc:: { Process, Close, {{{StartupEXE}}} Process, Close, joytokill.exe } Quote Link to comment Share on other sites More sharing options...
Undertherainbow Posted September 29, 2019 Share Posted September 29, 2019 (edited) @Aevans0001 Just open ahk under emulator in launchbox and paste $Esc:: { Process, Close, {{{StartupEXE}}} Process, Close, joytokill.exe } when u press Escape it will close both emulator and joytokey Edited September 29, 2019 by Undertherainbow Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted September 29, 2019 Share Posted September 29, 2019 Nothing has changed lately with AHK or any of that scripting stuff. Hopefully @Undertherainbow can help you get up and running @Aevans0001. 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.