Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Mouse Coordinates Inconsistent

$
0
0
I'm writing some code to automatically patch a few games, and for the game Firefall I am using AutoIt to automatically click on the patch/launch game button. Unfortunately, this button is not a control object so I have to use mouse coordinates.

Here is my code:

Func WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc

Opt("MouseCoordMode", 0)
While True
WinWaitActivate("[REGEXPCLASS:HwndWrapper\[(Launcher|FirefallPatcher)\.exe.*]","")
MouseClick("left", 775, 475)
Sleep(15000)
WEnd


The problem I am experiencing is that the mouse coordinates are inconsistent. If I let this script run for 30 seconds, the first two clicks will usually click on the wrong location, but the third click and beyond will select the right location.

Any ideas? I have seen this for other launcher type applications as well.

EDIT: I have also tried using absolute coordinates in conjunction with the position of the window. This runs into the same problem.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>