### Author Topic: Running a .ahk script  (Read 678 times)

• Full Member
• Posts: 40
##### Running a .ahk script
« 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 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.

AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

#### rand0m

• Sr. Member
• Posts: 272
##### Re: Running a .ahk script
« Reply #1 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.

• Full Member
• Posts: 40
##### Re: Running a .ahk script
« Reply #2 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.
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

• Full Member
• Posts: 40
##### Re: Running a .ahk script
« Reply #3 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