Atomix Posted June 6, 2010 Posted June 6, 2010 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.
Zibit Posted June 6, 2010 Posted June 6, 2010 that could easily be the game's fault... and is im thinking this is used for botting, am i correct ? Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam
Atomix Posted June 6, 2010 Author Posted June 6, 2010 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.
JohnOne Posted June 6, 2010 Posted June 6, 2010 Try defining the option MouseCoordMode, found in the helpfile under "opt". AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Atomix Posted June 6, 2010 Author Posted June 6, 2010 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:
Fi0da Posted June 7, 2010 Posted June 7, 2010 Im not test it but try whitout Winative blockinput(1) mouseclick("left", 544, 350) sleep(200) MouseMove(190, 521, 20) sleep(100) mouseclick("Left") I read ... I update ... I learn ...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now