eruvis Posted September 22, 2009 Share Posted September 22, 2009 i posted a reply to an old topic today but im not sure if the topic gets bumped up or not so im re-posting in a new topic. i have a similar type of request but do not really understand the commands that well yet, this is what i tried to do: $color=PixelSearch(1,400,400,1,0xFFBA4A) mousemove($color) mouseclick("left") $color=PixelSearch(1,400,400,1,0x94BE42) mousemove($color) mouseclick("left") its supposed to search a rectangle of 400 length and width (im assuming left = 0, right = max, down = 0 and up = max) ? for color 1, 0xFFBA4A, move to that color, click it, then search for color 2, 0x94BE41 move to that color and then click it. thanks in advance to all who help =) Link to comment Share on other sites More sharing options...
jebus495 Posted September 22, 2009 Share Posted September 22, 2009 i posted a reply to an old topic today but im not sure if the topic gets bumped up or not so im re-posting in a new topic. i have a similar type of request but do not really understand the commands that well yet, this is what i tried to do: $color=PixelSearch(1,400,400,1,0xFFBA4A) mousemove($color) mouseclick("left") $color=PixelSearch(1,400,400,1,0x94BE42) mousemove($color) mouseclick("left") its supposed to search a rectangle of 400 length and width (im assuming left = 0, right = max, down = 0 and up = max) ? for color 1, 0xFFBA4A, move to that color, click it, then search for color 2, 0x94BE41 move to that color and then click it. thanks in advance to all who help =) First off, you probably aren't using the PixelSearch parameters correctly. It goes left, top, right, bottom. left = leftmost X value top = topmost Y value right = rightmost X value bottom = lowest Y value These coordinates specify the location of a square to search for a color. Try using the window info tool to help you find coordinates. (X is horizontal and Y is vertical.) Next you need to know how to use your $color variable. When a PixelSearch is correct it will return an array. So $color will be like $color[0] and $color[1] $color[0] is you X and $color[1] is your Y. So your: mousemove($color) mouseclick("left") Will become: mousemove($color[0], $color[1]) mouseclick("left") Link to comment Share on other sites More sharing options...
eruvis Posted September 22, 2009 Author Share Posted September 22, 2009 thanks! im going to try it out. Link to comment Share on other sites More sharing options...
jebus495 Posted September 22, 2009 Share Posted September 22, 2009 (edited) thanks! im going to try it out. Once you find appropriate coordinates for the area you are searching for this color you can probably use the following script. After changing the search area of course. Do $color = PixelSearch(1,400,400,1,0xFFBA4A) Until Not @error MouseMove($color[0], $color[1]) mouseclick("left") Do $color=PixelSearch(1,400,400,1,0x94BE42) Until Not @error MouseMove($color[0], $color[1]) mouseclick("left") Edited September 22, 2009 by jebus495 Link to comment Share on other sites More sharing options...
eruvis Posted September 22, 2009 Author Share Posted September 22, 2009 i got it to work with the right cords, thanks alot. just one more thing... how do i loop this a few times? ive seen some people do, something like: Do ....... ...... .... $loop + 1 Until $loop = 100 im still learning the syntax Link to comment Share on other sites More sharing options...
eruvis Posted September 22, 2009 Author Share Posted September 22, 2009 nevermind, thanks a ton i got it: $loop=0 Do Do $color = PixelSearch(66,400,827,660,0xFFBA4A) Until Not @error MouseMove($color[0], $color[1]) mouseclick("left") Do $color=PixelSearch(66,400,827,660,0x94BE42) Until Not @error MouseMove($color[0]+40, $color[1],50) mouseclick("left") $loop=$loop+1 Until $loop=10 Link to comment Share on other sites More sharing options...
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