Sign in to follow this  
Followers 0
Misha

MouseMove+pos

5 posts in this topic

#1 ·  Posted (edited)

while 1
         $MousePos = MouseGetPos()
         MouseMove($MousePos[0]+1,$MousePos[1])
         MouseClick("Right")
         MouseMove($MousePos[0]-1,$MousePos[1])
wend

This evnetually moves left, why...

Edited by Misha

Share this post


Link to post
Share on other sites



$MousePos[0]-1 = move left from last MousePos ($MousePos = MouseGetPos()) recorded 1 pixel.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

yea but MouseMove($MousePos[0]+1,$MousePos[1]) it moves forward...and then MouseMove($MousePos[0]-1,$MousePos[1]) moves it back..

Share this post


Link to post
Share on other sites

yea but MouseMove($MousePos[0]+1,$MousePos[1]) it moves forward...and then MouseMove($MousePos[0]-1,$MousePos[1]) moves it back..

Are you not seeing what I'm saying? You don't get the mouse position after you move it to the right 1 you only get it once... So this is how yours goes

1. Get current position, lets say it is 500, 500

2. Move Right 1 pixel From 500, 500 to 501, 500

3. Move Left 1 pixel From 500, 500 to 499, 500

You have to tell it what to do, it doesn't make guesses :whistle: .


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Oh........................................yea you are right thanks alot ^^

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