Jump to content

pixelsearch help


eruvis
 Share

Recommended Posts

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

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

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 by jebus495
Link to comment
Share on other sites

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

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...