Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: myriadgamers on December 25, 2018, 04:30:12 PM

Title: Running a .ahk script
Post by: myriadgamers on December 25, 2018, 04:30:12 PM
I am sure I am doing this wrong but here is what is going on.

I am opening up deltarune and trying to get the script to hit F4 to full screen it. Now the script works just fine if I run it straight from the desktop. However it definitly is giving me issues through Attractmode. As it opens the game but will not seem to Hit F4

Executable C:\Program Files (x86)\SURVEY_PROGRAM\DELTARUNE.exe
Working Directory C:\Program Files (x86)\SURVEY_PROGRAM
Rom paths  C:\Users\MyriadArcade\Desktop\Attract Mode\attract-v2.4.1-win64\emulators\DeltaRune
Rom extensions .ahk

And here is the script file

Run, DELTARUNE.exe, C:\Program Files (x86)\SURVEY_PROGRAM, max
Sleep, 3000
Controlsend,,{F4}, ahk_exe DeltaRune.exe

Which again runs just fine from the desktop but not with attractmode. I am certain I am calling the AHK file wrong but I am still learning the ropes here. Any advise would be welcome.




Title: Re: Running a .ahk script
Post by: rand0m on December 25, 2018, 11:54:36 PM
Right now you are trying to run ahk script through deltarune.exe (executable). Is that what you are aiming for? because after executing deltarune.exe (provided deltarune runs scripts) you are again trying to run another instance of deltarune with arguments.
Title: Re: Running a .ahk script
Post by: myriadgamers on December 26, 2018, 06:10:11 AM
gotcha, so I need to only run the AHK file.. Thank you this helps I will tinker with that and see if that fixes it. By replacing the deltarune executable with the AHK executable.
Title: Re: Running a .ahk script
Post by: myriadgamers on December 29, 2018, 06:33:02 AM
So I pointed my Executable at the AHK program. Then I added some extra code since my original script closed after it ran which actually causes attract mode to wake back up. It is all working now but here is the final script just in case someone is interested.

Run, DELTARUNE.exe, C:\Program Files (x86)\SURVEY_PROGRAM, max
sleep, 3000
Send {F4}
KeyWait, Joy12, D
WinClose, ahk_exe DELTARUNE.exe