Jmoore3274 Posted September 23, 2009 Posted September 23, 2009 (edited) I have been trying to figure out how to make the mouse move pixel by pixel. For example, I would like the script to look for a certain color, move the mouse to it then move a specified number of pixels X then a number of pixels Y. Example Script is below. WinMove( "Window", "", 0,0 ) While 1 $Coord = PixelSearch( 778, 179, 801, 409, 0xA9A907, 10 ) If @Error = 0 Then MouseMove( $coord ) Sleep( 200 ) MouseMove( A number of pixels X ) Sleep( 200 ) MouseMove( A Number of Pixels Y ) Sleep( 200 ) MouseClick( "Left" ) EndIf Sleep( 50000 ) Wend Sorry if my scripting is wrong. Im still new at this. Thanks in advance Edited September 23, 2009 by Jmoore3274
omikron48 Posted September 23, 2009 Posted September 23, 2009 Store your current mouse coordinates into variables and use them as offsets when you move x or y pixels. You can also find out the current coordinates of the mouse pointer using MouseGetPos.
Demonic Posted September 23, 2009 Posted September 23, 2009 I have been trying to figure out how to make the mouse move pixel by pixel. For example, I would like the script to look for a certain color, move the mouse to it then move a specified number of pixels X then a number of pixels Y. Example Script is below. WinMove( "Window", "", 0,0 ) While 1 $Coord = PixelSearch( 778, 179, 801, 409, 0xA9A907, 10 ) If @Error = 0 Then MouseMove($Coord[0], $Coord[1]) Sleep( 200 ) $Coord[0] = $Coord[0] + 50 ; Moves 50 pixels to the right of original x coordinate MouseMove($Coord[0], $Coord[1], 0) Sleep( 200 ) $Coord[1] = $Coord[1] + 25 ; Moves 25 pixels up from 50 pixels to the right of the original coordinate MouseMove($Coord[0], $Coord[1]) Sleep( 200 ) MouseClick( "Left" ) EndIf Sleep( 50000 ) Wend Sorry if my scripting is wrong. Im still new at this. Thanks in advance
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