Sign in to follow this  
Followers 0
lammaer

Mouse coordinates not stable...

5 posts in this topic

I automated several games (3d and not 3d as well) before, and two days ago, I just tried to do the same in an old MS game namd Freelancer.

I've created screenshots as usual to get the coordinates of the buttons, texts etc. and when I run my basic scripts, somehow it clicked all the way on random position.

At the end, I've created a single mousemove script, and realized, that the same coordinates mean totally random mouse positions in every run.

Then I used the AutoIT info window, and it was true: when I move the mouse to the same position, I didnt get the same coordinates in the info window.

Just check the linked screenshots: the mouse is basically positioned to the same location (top left corner of the window), but the info window shows two different coordinates (the screenshot was created with Coord Mode = screen option, the position of the Freelancer window was not changed between the screenshots all. I tried window/client coordmodes as well, tried to run the application in full screen/windowed mode, but nothing helped: moving the mouse from script to a given coordinate resulted different positions on the screen.

I'm sure it is not the fault of the Autoit, as it worked fine in case of other - even more complex - games. I just wonder what the hell happens in case of Freelancer...

Anyone have any idea?

http://trlrf.cjb.hu/images/FreeLancer1.jpg

http://trlrf.cjb.hu/images/FreeLancer2.jpg

Share this post


Link to post
Share on other sites



. . . I tried window/client coordmodes as well, tried to run the application in full screen/windowed mode, but nothing helped: . . .

Anyone have any idea?

Make sure the Opt("MouseCoordMode", #) matches the mode you're using within AU3Info. Search the Help file for more details. Likewise, you might want to look up WinMove() to ensure you're using target pixels are when they need to be.

Share this post


Link to post
Share on other sites

Looking at the screenshots, it seems to me that AU3 Info Window is reporting on your windows cursor, not the one in the game. Assuming that the screen has a resolution of 1024x768, then the reported cursor position (506, 399) is located approximately in the centre of the screen (centre is 512, 384) . This appears to be the case. In the second screenshot, you've moved the cursor left and down and that ties in correctly with the reported position (223, 441).

Share this post


Link to post
Share on other sites

Thanks for the comments.

Regarding the coordmodes: of course, in the code i tried the same mouse and pixelcoordmode as I used in the AutoitInfowindow.

About the two cursors: anyone have any ide how could I catch and move the ingame cursor, instead of the somehow still existing windows cursor? The problem is, even if I figure out the proper ingame coordinates, it seem mousemove still moves the window cursor, not the ingame one (I even tried full screen mode, same result).

Any hint/tip would be nice..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0