Sign in to follow this  
Followers 0
jackyyll

Find Color Spiral

4 posts in this topic

How do you do a spiral pixel color search in specified coordinates? I want it to search in this square and then if it's only black, do one thing. If it's anything besides black, do another thing. Can anyone help? Thanks

Share this post


Link to post
Share on other sites



How do you do a spiral pixel color search in specified coordinates? I want it to search in this square and then if it's only black, do one thing. If it's anything besides black, do another thing. Can anyone help? Thanks

Lookup PixelSearch in the help files.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

How do you do a spiral pixel color search in specified coordinates? I want it to search in this square and then if it's only black, do one thing. If it's anything besides black, do another thing. Can anyone help? Thanks

Could you elaborate on the "spiral" ?

If it's just the square, using the square coords of top left x and y to bottom right x and y you could do:

Opt("PixelCoordMode", 0); check help if you need to change the 0 to 1 or 2

$TOPx = 0
$TOPy = 0; Starting points
$BOTTOMx = 100
$BOTTOMy = 100; Ending points
$COLOR_BLACK = 0X000000

$Pix = PixelSearch($TOPx, $TOPy, $BOTTOMx, $BOTTOMy, $COLOR_BLACK)

If $Pix <> 1 Then
   ; Do something
EndIf

This doesn't go in a "spiral" search though, but top to bottom and left to right (I think :P )...


[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

I think that your best bet would be to control the "spiralling" behavior yourself.

In other words, restrict your pixelsearch 'window' to a very small block, and then

move the origin of said block in the pattern you want using the proper math to

represent the pattern.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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