Sign in to follow this  
Followers 0
nyxx24

Pixel Search

5 posts in this topic

#1 ·  Posted (edited)

Hello,

I have used the search and I am looking for more help..

I am trying to add a pixel search if then to my script and it's not working

What I want is at a certain point to have it check for a grey\white shade in a small area

and if found continue and if not found skip down to a lower section of the same script..

I tried and I do not get any errors but it does not work if the color is there or not it just

keeps going either way

I do not know if it's not working because the color is wrong due to shades and transparencies in the window or because I am doing it wrong script wise..

I got this digging through more articles, I am looking for a grey shade or an off shade of white..

PixelSearch(1395, 210, 1395, 210, 0xFFFFFF, 5)

If @error Then

MsgBox(0, "Not found", "I didn't find the color white")

MsgBox(0, "Color Found", PixelGetColor(1395, 210))

Else

MsgBox(0, "Found", "Found the color white")

EndIf

But It returns the color, 16777215 which from what I have read is white..

So why is it erroring out?

Edited by nyxx24

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Well pixel get color gives me BFBFBF which is about 63 or so shades of RGB value off

so I expanded the shade range to 100 since the background color is almost black like

5,5,5 RGB.. and I will see how that works

Edited by nyxx24

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Using what I have found so far..

I tried using the following yesterday and this morning to see how it worked

;Pixel search if negative then proceed if positive then skip to leave

PixelSearch(1395, 210, 1395, 210, 0XBFBFBF, 100)

If @error Then

(it continues with several lines of script or skips to:)

;Leave

Else

EndIf

Well as an update I seem to have answered my own questions with more use of search, help and trial by error.

Edited by nyxx24

Share this post


Link to post
Share on other sites

It seems to be working at the moment.. if it starts looking like its not working I will check back! =-)

As a question, and at time of posting this I am not at home so I do not have access to the help file untill tonight.

I have seen some mention of a color checksum command would it be more suited to this since I am checking for the presence of a certain color in a certain pixel location?

Share this post


Link to post
Share on other sites

just a quick help for you.... your uing pixelsearch just for 1 pixel.. why not use

$col=pixelgetcolor(1395,210)
if $col=16777215 then
msgbox(0,"","Found 16777215",0)
else
msgbox(0,"","found @ 1395,210"&$col ,0)
endif

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