oke so i'm trying to controlclick on a pop up window in dungeon defenders 2 while the game.exe is inactive.
this is the code i'm working with. (it also sends g. that works fine)
Code: Select all
SetTimer Click, 1000
wintitle = Dungeon Defenders 2
SetTitleMatchMode, 2
SetControlDelay -1
IfWinExist %wintitle%
F2::Toggle := !Toggle
Click:
If (!Toggle)
Return
Controlsend,,g, %wintitle%
ControlClick, x860 y700, %wintitle%
Return
F8:: ExitApp
but it does spam left click in the game
http://postimg.org/image/jjoz8myol/
if i use a code like this with the window active it works perfectly..
Code: Select all
SetTimer Click, 1000
F2::Toggle := !Toggle
Click:
If (!Toggle)
Return
x = 860;
y = 700;
Click
Send g
MouseClick, left, x, y
Return