Jump to content

PixelSearch and PixelGetColor problem


Recommended Posts

CODE
$Pos1 = PixelSearch(0+$pixelradius, 0+$pixelradius, @DesktopWidth-$pixelradius, @DesktopHeight-$pixelradius, 0xb21b1b, 8)

If IsArray($Pos1) And hex(PixelGetColor($Pos1[0],$Pos1[1]+1),6) = "b21b1b" And (_IsPressed("02", $DllHandle) = 1) Then

what I'm trying to do is to compare the 2 colors and make sure they are the same

i know that at $Pos1 there is a variable of 8 what I'm trying to do is load that variable into PixelGetColor and make sure they are the same

Link to comment
Share on other sites

  • Moderators

You don't need the "hex" part or PixelGetColor.

Since you are using PixelSearch, just get rid of the shade variation, and you'll always know it's the same.

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

If IsArray($Pos1) And PixelGetColor($Pos1[0],$Pos1[1],6) = PixelGetColor($Pos1[0],$Pos1[1]+4,6) And (_IsPressed("02", $DllHandle) = 1) Then

i worked it out you got to love this program for its simplicity

basically its saying move 4 pixels in front and compare

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