Sign in to follow this  
Followers 0
nephilim

PixelSearch and PixelGetColor problem

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


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

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