Newbie here! Need help before I pull my hair out!

Ask gaming related questions
jcstahl1
Posts: 1
Joined: 10 Apr 2024, 10:38

Newbie here! Need help before I pull my hair out!

10 Apr 2024, 10:48

I'm really new to using AHK and I'm trying to learn on my own as much as I can but this one has me stumped.

I'm trying to make a script that will run until it detects a specific game exe running (gs2.exe), after it detects the game I want to send Alt + Enter to toggle to fullscreen. I googled and tried a few different things and I can't get it to work.

Here is what I have currently:

Code: Select all

SetTimer CheckProgram, 1000
return

CheckProgram:
If WinExist("ahk_exe gs2.exe")
{
    Send "{Alt down}{Enter}{Alt up}"
}
return
PLEASE HELP
User avatar
boiler
Posts: 17120
Joined: 21 Dec 2014, 02:44

Re: Newbie here! Need help before I pull my hair out!

10 Apr 2024, 12:49

Which version of AHK are you trying to use -- v1 or v2? You posted in the v2 section, but apparently most new users that are actually using v1 don't realize they are posting in the v2 section even though the forum asks them to be sure. Your code has elements of both, so it would work for neither.
Rohwedder
Posts: 7697
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Newbie here! Need help before I pull my hair out!

11 Apr 2024, 09:57

Hallo,
for me, it was much more v1 than v2. Logically, Google doesn't know v2 that well yet.

Code: Select all

#Requires AutoHotkey v1.1.33
#Persistent
SetTimer CheckProgram, 1000
return

CheckProgram:
If WinExist("ahk_exe gs2.exe")
{
	SetTimer CheckProgram, Off ; ???
	WinActivate ; ???
	Send {Alt down}{Enter}{Alt up}
}
return

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 11 guests