Jump to content
Sign in to follow this  
Axufuris

Need help with Pixels

Recommended Posts

Axufuris

I need some help. For some reason i have this function going but it will not work for some reason. It acts like it finds the second color before it is even on the screen. Please help

Func Undock()

PrintStatus("Undocking.")

MouseClick("left", $Undock[0], $Undock[1], 1, $MouseSpeed)

PrintStatus("Black")

Do

Sleep(1000)

Until (PixelGetColor($CheckIfUndocked[0], $CheckIfUndocked[1]) < Dec("000000") + 1 AND PixelGetColor($CheckIfUndocked[0], $CheckIfUndocked[1]) > Dec("000000") - 1)

PrintStatus("color")

Do

Sleep(1000)

Until (PixelGetColor($CheckIfUndocked[0], $CheckIfUndocked[1]) < Dec("464B32") + 5 AND PixelGetColor($CheckIfUndocked[0], $CheckIfUndocked[1]) > Dec("464B32") - 5); 15132390

Sleep(3000)

CheckPauseStop()

Return 3

EndFunc

Share this post


Link to post
Share on other sites
Axufuris

Come on, Does anybody know how to help me? This is driving me crazy. I don't want to check for an exact color because i am doing this on EVE and the colors change. But that so far seems to be the onlyway it will work. I want to check between a small range of colors.

Share this post


Link to post
Share on other sites
Axufuris

Look at PixelSearch.

I looked at pixelSearch and it doesn't seem like what i would need. I already know what spot i'm checking the pixel at. I don't have to look for the pixel, i just need to see if that spot turns to that color or really close.

Share this post


Link to post
Share on other sites
cppman

You don't need to "search" for the pixel. You can just use it to specify the color shade variation (0 - 255).

Something like this, anyways...

Func IsPixelMatch($x, $y, $color, $variation = 0)
       PixelSearch($x, $y, $x, $y, $color, $variation)
       return not @error ;or.. return @error <> 1
EndFunc
Edited by cppman

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  

×