Jump to content
LaunchBox Community Forums

AHK Scripting Difficulties


Shwiftyfive

Recommended Posts

Hello everyone,

I'm trying to get the pause screen scripts working for BigBox. Some of these scripts I've used have worked for other users. I've used similar scripts for both bsnes and mesen. Here is what I've tried so far for the exit script :

1. Leave blank # This works most of the time, but not in about 10% of cases.

2. Doesn't work
 

Send {e down}
Sleep 50
Send {e up}

3. This works, but you aren't supposed to close the emulator this way. Something about not saving properly. Also, I really need to be able to send keystrokes so I can get the save state, load state, etc. functionality working with the pause screen.
 

Process, Close, bsnes.exe

2. Doesn't work

 Send, e

3. Doesn't work

SetTimer, SendKey, 1000 ; Checks every second
return

SendKey:
IfWinActive, ahk_exe bsnes.exe
{
    Send, e
}
return

4. Doesn't work

SetTimer, SendKey, 1000 ; Checks every second
return

SendKey:
ControlSend,, e, ahk_exe bsnes.exe
return

 

Thanks for taking a look!

Link to comment
Share on other sites

I'm not real familiar with those emulators but based on your many attempts, if your press "E" on the keyboard, they'll exit?

If that's the case, along with a key delay (sleep 50), you may need a longer key-press duration to be able to send from AHK.

SetKeyDelay, 125, 50
Send, e

 

Using Process, Close is sort of like pulling the computer plug out of the socket to exit Windows.

The "nice" way is to use WinClose.  The 'nice' default way is to use:

WinClose, ahk_exe {{{StartupEXE}}}

 

If that doesn't work, you can get a little more direct:

 WinClose, ahk_exe bsnes.exe
Link to comment
Share on other sites

Thank you for your reply!

Yes if I press e on the keyboard they exit. That is what I've mapped in the emulator.

Your first suggestion worked for bsnes. Reset, load/save state, and exit all work. However, that doesn't work with mesen. Something odd happens where after selecting Reset, load/save state, or exit, I am presented with a black screen that is stuck. I can reopen the save menu, but at that point even resume game gets me presented with the same black screen. The only way I can get out of it is to ctrl alt del. 

Also, testing new scripts seems extremely tedious. Is there a faster way than open launch box, change script, close, open bigbox, test, close, repeat? I can't seem to pull up the launchbox pause screen not sure why.

Link to comment
Share on other sites

I did figure out how to get the pause screen working for Launchbox so I can more rapidly test scripts. Still nothing for mesen though. When testing scripts in Launchbox, instead of a black screen I come back to a windowed mesen and hear and error noise. Mesen has lost focus. Reset, load/save state, or exit doesn't happen.

Link to comment
Share on other sites

Thank you. Using Alt+Tab revealed that the mesen window was active and that was the black screen. Turning off the startup screen removes the black screen and now it behaves like it does in launchbox mode.  I see a windowed mesen and hear an error noise. Reset, load/save state, or exit doesn't happen.

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...