Jump to content

Find Color Spiral


 Share

Recommended Posts

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.


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

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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.

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