Jump to content

Mouse coordinates change randomly.


Recommended Posts

Hello, I have a problem with mouse coordination system using AutoIt program. The problem is quite simple - when I activate a window where I want the script to execute, I place my mouse on a specific spot to get the coordinates. For example, at button A location coordinates would be: "mousemove, 542, 413"

Now when I run the script, the mouse doesn't move to the button A as previously indicated, but moves to a random location.

What I have found out is that when ever I switch between several programs/window using ALT+TAB or just start button and then go back to the program I am writing a script for, then the whole coordination system has changed.

For example, if at button A coordinates where, as mentioned, 542, 413. Then the next time I switch to another window, then the coordinates would be different.

What could be the cause and solution for this problem?

I read that setting coordmode to relative might help, but no luck, here is the specific code im referring to:

WinWaitActive("Freelancer")
 blockinput(1)
 mouseclick("left", 544, 350)
 sleep(200)
 MouseMove(190, 521, 20)
 sleep(100)
 mouseclick("Left")

I recorded a video to show you how this is happening:

In the video, you can see that there are 2 mouse cursors, I was surprised by that. Well, for getting coordinates, I always used the animated cursor, which becomes available when I select freelancer as the active window. But perhaps the actual cursor that is getting the actual coordinates is the other one - the invisible one? (You can see the window cursor in video only, because it is a recording, when I was perfoming those actions, that cursor was invisible to me)

I must add, that I tried also using "controlclick", but since AutoIt window info program could not show any control names, then it didn't work.

Thank you in advance.

Link to comment
Share on other sites

No, I'm not trying to bot, I'm currently learning autoit, and I stumbled upon this major problem. I'm trying to create a script that would change freelancer's video settings as they keep resetting to default everytime I exit the application, so it's quite painful to do it every time myself.

Well, what could be the problem that mouse doesn't move according to given coordinates? I noticed, that if I used autoit windows info program and used "Finder tool" to get the coordinates without activating freelancer (using window mode) then it gave me the right coordinates, which are always the same.

BUT, there is another problem, when I execute the script to make my mouse move to the specific coordinates, I can see the windows default mouse pointer moving slightly ahead of the animated pointer and in that way messing everything up.

As far as I understand this, the windows cursor is the one that dictates everything - right coordinates and right button presses, it seems it is somehow interrupting the script.

Link to comment
Share on other sites

I tried doing that (all 3 available options).

Alright, here is a small video I recorded, so you can see EXACTLY what is happening, how the mouse is moving and what's getting in the way.

Please watch it:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...