Hyperspin Game and watch

Ask gaming related questions
doohan
Posts: 3
Joined: 08 Mar 2016, 15:00

Hyperspin Game and watch

12 Dec 2017, 16:31

Hello,

To run Game and Watch exes, I'v tried something simple working:

In the same folder than the games: a ahk script by game:

Run, E:\Nintendo\Game & Watch\Jeux\Banana\Banana.exe
Esc::
Process, Close, Banana.exe
ExitAPP
return

Anyone knows how to add run Xpadder before launching the game and close Xpadder after closing the game?

Something like Runwait?

Thanks and regards,  
A_AhkUser
Posts: 872
Joined: 06 Mar 2017, 16:18
Location: France

Re: Hyperspin Game and watch

14 Dec 2017, 22:06

Hi doohan and welcolme to the AHK community :D


Ruwait is actually a relevant option in this case. Here's a commented example using notepad (as Xpadder):

Code: Select all

WM_SYSCOMMAND := "0x112", SC_CLOSE := "0xF060" ; values used with PostMessage below - see WinClose > remarks in the documentation

#Persistent ; to keep a script that contains only timers running
SetTimer, mySubroutine, -1 ; runs a timer (a negative period like -1 make the timer run only once). The purpose of running such a timer is here to open a new thread and that way prevent the code beneath - if any - from being postponed by the runwait command
run, %A_WinDir%\system32\notepad.exe,, Min, PID ; runs notepad and stores its unique process ID (PID) in 'PID'; min will run it minimized
; some code...
return ; end of the auto-execute part of the script

mySubroutine: ; subroutine executed by the timer
WinWait, ahk_pid %PID% ; waits until notepad window exists
runwait, "E:\Nintendo\Game & Watch\Jeux\Banana\Banana.exe"
PostMessage, %WM_SYSCOMMAND%, %SC_CLOSE%,,, ahk_pid %PID% ; less forcefull than process, close -  similar in effect to pressing Alt-F4 or clicking the window's close button in its title bar.
ExitApp
Hope this helps.
[url=https://autohotkey.com/boards/viewtopic.php?f=56&p=215673#p215673][b][font=Segoe UI][color=#1ea2db]Video Game[/color] [color=#bbbbbb]Reader[/color][/font][/b][/url] eAutocomplete


Return to “Gaming”

Who is online

Users browsing this forum: Evil-e, Google [Bot], LitFam and 16 guests