Jump to content
LaunchBox Community Forums
Aevans0001

Autohotkey Startup/Exit scripts issues

Recommended Posts

Posted (edited)

So first I got my first commodore 64 game working using Joytokey and additional apps.  I put a startup app to load joytokey, and then a batch file to kill joytokey after closing emulator.  That worked, however it only worked for the one game.  I need 20,000 C64 games to work.  So I tried an autohotkey script.  So I got the autohotkey to load jpytpkeu amd an exit script to run the bat file.  However, it didn't run the batch file.  So then I tried using the following cod e to kill it.

if WinExist("JoyToKey Ver6.1.1 : Joytokey")
    WinClose ; use the window found above 

this again failed to load upon exit of the emulator.  I have verified both ways worked independently, but not through Launchbox.

------------------------------Edit--------------------------

 

Ok so I got it working, however I would lke to see how to do it the proper way with ahk script in begging and end.  Here is the code I used

 

Run, d:\games\joytokey\joytokey.exe
WinWait, ahk_exe x64.exe
WinWaitClose  ; Wait for the exact window found by WinWait to be closed.
Run, "d:\games\joytokey\joytokeykill.bat"

and here is my version of joytokeykill.bat

taskkill /IM joytokey.exe /F

 

This is specifically for Winvice but you can use it with any emulator, you just change the ahk_exe section

Edited by Aevans0001

Share this post


Link to post
Share on other sites

There isn't currently a way to setup an emulator with a 'run before main application' and 'run after main main application ' like you can per game.   However under "Edit Emulator" you can add your script under the "Running AutoHotKey Script" tab. Also, you could add your bat file command to the script instead of calling it.

Run, d:\games\joytokey\joytokey.exe
WinWait, ahk_exe x64.exe
WinWaitClose  ; Wait for the exact window found by WinWait to be closed.
Run taskill.exe /IM joytokey.exe /F,, Hide

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...