Jump to content

Recommended Posts

  • Moderators
Posted

I want it to let me know when all 4 pixels are equal to the right colors and are in the right order

I don't know how to do it. It would be a cool UDF to have. Any Ideas, Please help, Thanks

Could you not use PixelChecksum()?
  • Moderators
Posted (edited)

no because that just tells me if there different, I need it to tell me if pixel 1=00ff00 2=33ff00 3=ff0000 and 4=000000 and if each is equal to that then output where this is

2 For Loops, an $x and a $y.
Opt('PixelCoordMode', 2)
Local $xCoord[3] = ['', 344, 345], $yCoord[3] = ['', 5, 6], $Color[5] = ['', 0x00FF00, 0x33FF00, 0xFF0000, 0x000000]
Local $Count = 0

For $x = 1 To 2
    For $y = 1 To 2
        $PixColor = PixelGetColor($xCoord[$x], $yCoord[$y])
        For $iColorCount = 1 To 4
            If ($PixColor == $Color[$iColorCount]) Then
                $Count += 1; Whatever your doing here
                ExitLoop
            EndIf
        Next
    Next
Next

MsgBox(0, 'Test', 'The Colors were found ' & $Count & ' Times')

Edit

I didn't notice you had 4 colors you were looking for... Put those in an array also.

Edited by SmOke_N

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.

  • Moderators
Posted

This will work if the colors are always in the same order.

Use this to record the 2x2 square of colors.

Then use this to find what you recorded.

Just modify it to do what you want after it finds it.

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
×
×
  • Create New...