Sign in to follow this  
Followers 0
eruvis

pixelsearch help

6 posts in this topic

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 =)

Share this post


Link to post
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")

Share this post


Link to post
Share on other sites

thanks! im going to try it out.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by jebus495

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

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