shea851 Posted April 4, 2007 Share Posted April 4, 2007 (edited) Imagine you are trying to automate something, and in order to do it, you have to check a certain pixel (or many pixels) for a specific color. However, you can't because this pixel is constantly changing color by a tiny bit (slightly transparent) and there is no way to make it opaque. Is it possible to search 1 specific pixel for a range of colors? Like for example; check pixel for any random shade of white and you do this, but if it's a shade of anything else, do that. Get what I'm saying? Is this possible? Edited April 4, 2007 by shea851 Link to comment Share on other sites More sharing options...
xcal Posted April 4, 2007 Share Posted April 4, 2007 PixelSearch() allows for shade variations. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Kickassjoe Posted April 4, 2007 Share Posted April 4, 2007 You could also call PixelGetColor(), and then do something, and then PixelGetColor again, and compare the two, and if the second one is different from the first, preform a different action. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
shea851 Posted April 4, 2007 Author Share Posted April 4, 2007 (edited) It does allow for shade variation.. however I have no idea how to use arrays... Is there a way to do this without involving arrays in any way? ;checks 1 pixel to see if it is white or within 100 shades of white, if it is, the $coord will be set to those coords, if it is not, $coord will be set to nothing? $coord = PixelSearch( 893, 75, 893, 75, 0xFFFFFF, 100 ) ;if $coord is equal to those coords, then it'll do something Func check() If ($coord[0] & $coord[1]) = (893, 75) Then I keep getting some subscript error, I know my coding is flawed, but i'm not sure how else to use this Pixelsearch function... Edited April 4, 2007 by shea851 Link to comment Share on other sites More sharing options...
jvanegmond Posted April 4, 2007 Share Posted April 4, 2007 No.. It returns an array, so you have to use arrays. And come on,,, Arrays are EASY!! github.com/jvanegmond Link to comment Share on other sites More sharing options...
shea851 Posted April 4, 2007 Author Share Posted April 4, 2007 (edited) They are probably easy if you've used them at least once. Which I haven't Anyways though, I found these lines of code elsewhere in the forum, which look like they'll help me get started on my first array... Func SomeFunction() $coord = PixelSearch( 28, 59, 28, 59, 0x7B96DE, 10 ) If IsArray($coord) Then;If pixel color is 0x7B96DE MouseClick("left", 985, 359, 1, 1) ;then move to mouse coordinates (28, 59) Sleep(5000) ;Wait 5 seconds SomeOtherFunction() ;Start Some Function EndIf EndFunc If not, i'll be back! Thanks again for the help. Edited April 4, 2007 by shea851 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now