Jump to content
Sign in to follow this  
Sycondaman

Mouse Coordinates Inconsistent

Recommended Posts

Sycondaman

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.

Edited by Sycondaman

Share this post


Link to post
Share on other sites
Tripredacus

FirefallPatcher is a game file for the game Firefall?

http://www.firefallthegame.com/about-firefall/

Share this post


Link to post
Share on other sites
Sycondaman

FirefallPatcher is a game file for the game Firefall?

http://www.firefallthegame.com/about-firefall/

Correct. There are actually two files that it switches between, Launcher and FirefallPatcher. The window regex works fine (the window will move to the foreground when behind other windows), but the clicking will happen twice at the wrong location and then in the correct location. I have also seen this behavior with the same code but with different windows.

For now I think I'm going to separate click and move and only click when I detect the mouse coordinates are in the correct position, but I'm still curious as to why this would be inconsistent.

Share this post


Link to post
Share on other sites
Tripredacus

You won't find the help you are looking for here.

http://www.autoitscript.com/forum/index.php?app=forums&module=extras&section=boardrules

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×