Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: manzarek on March 07, 2021, 09:57:58 AM

Title: (Solved) Exit from openBOR?
Post by: manzarek on March 07, 2021, 09:57:58 AM
This code works, but with a small flaw when you launch a game immediately after it returns to attract mode, but with the game still open, then when you click the exit button the game closes, but while the game is running attract mode continues work below, I don't know if I have explained myself well, does it do it to you too?
 wait_for_ESC.exe
Code: [Select]
#include <Misc.au3>

While 1
If _IsPressed ("1B") Then
ProcessClose("OpenBOR.exe")
;MsgBox(0, '', "Button pushed")
Exit
EndIf
WEnd

> OpenBOR

executable           cmd
args                 /c cd C:\attract\EMU\OpenBOR\[name] & start OpenBOR.exe & start C:\attract\EMU\OpenBOR\wait_for_ESC.exe
rompath              C:\attract\EMU\OpenBOR
romext               <DIR>
system               Arcade
info_source          thegamesdb.net
nb_mode_wait         3
exit_hotkey          Escape

NOTE: ESC-Key of AM doesn't work. So you need an external program like an autoit-script. Create wait_for_ESC.au3 and compile this sourcecode to .exe:
Title: Re: Exit from openBOR?
Post by: manzarek on March 08, 2021, 06:33:15 AM
Solved the exit button works even without the mess that was written.http://forum.attractmode.org/index.php?topic=503.msg4231#msg4231