I have the following ahk script to run C&C Generals:
#SingleInstance ignore
CoordMode, Mouse, Relative
Run C:\Users\william\Desktop\Generals.lnk
a::Left
s::Down
d::Right
w::Up
Loop{
sleep, 500
}
Until WinExist("ahk_exe Generals.exe")
sleep, 200
SetControlDelay -1
ControlClick, 1, ahk_class #32770, "", LEFT, 10, 300, 300
Loop{
sleep, 500
}
Until WinExist("ahk_exe Generals.exe")
WinWaitClose
Exit
The problem is that I can't get the ControlClick to click the second button.
I've read the manual but I can't figure out why this is not working. I don't even know if it clicks at all.
Got it working:
#SingleInstance ignore
CoordMode, Mouse, Relative
Run C:\Users\william\Desktop\Generals.lnk
winWait, ahk_exe Generals.exe
Click 300, 300
winWait, ahk_exe Generals.exe
WinWaitClose
Exit
a::Left
s::Down
d::Right
w::Up