Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Gaming Help (v1) • Problem with a WinActive and WinNotExist loop script

$
0
0
Hi,

I just did a loop for a game and wanted to send the keys when the windows is not active. I tested it with notepad and it works but the problems is when I change the PID to the game´s PID, it doesnt work. Any reason why? any solution? I have another script with "Send" command and it works too but only when the windows si active and I dont want that.

here´s the code:

CODE:

#IfWinNotexist, ahk_pid 1592

SendMode Input

<+F1::SetTimer, AFKMode, % (i:=!i) ? "" : "Off"
AFKMode:
ControlSend, Edit1, {a down}, ahk_pid 1592
Sleep 2000
ControlSend, Edit1, {a up}, ahk_pid 1592
ControlSend, Edit1, {d down}, ahk_pid 1592
Sleep 2000
ControlSend, Edit1, {d up}, ahk_pid 1592
return


and there is the one that works but only when windows is active:

CODE:

#IfWinActive, ahk_exe proven_ground_client.exe

SendMode Input

<+F1::SetTimer, AFKMode, % (i:=!i) ? "" : "Off"
AFKMode:
Send {a down}
Sleep 2000
Send {a up}
Send {d down}
Sleep 2000
Send {d up}
return



thanks in advance


[Mod action: Moved topic to the “Gaming” section.]

Statistics: Posted by uchihito — Today, 17:28



Viewing all articles
Browse latest Browse all 579

Trending Articles