XZ3R0 Posted July 7, 2009 Share Posted July 7, 2009 Is it possible to do a pixelsearch for colors in an array. and then have a different out come for the different colors found? ex: red is found, up key is pressed. blue is found down key is pressed. as of right now i have a different pixelsearch function for every color and its too slow. Link to comment Share on other sites More sharing options...
dantay9 Posted July 7, 2009 Share Posted July 7, 2009 I don't think this is possible. If you look at the help file, pixelsearch only returns the coordinates. Autoit doesn't support many color functions. There isn't a very high demand. You could try using adlibenable. If that isn't enough, you could pick up the beta version and use adlibregister. Link to comment Share on other sites More sharing options...
XZ3R0 Posted July 7, 2009 Author Share Posted July 7, 2009 Yea i didn't think so cause of the help file. I don't really see how adlibenable would help me run multiple pixlesearches faster. can you explain? Link to comment Share on other sites More sharing options...
dantay9 Posted July 7, 2009 Share Posted July 7, 2009 You are probably doing a large while loop with a lot of stuff inside. You can split the loop into two parts if you use adlibenable. The beta version of autoit allows you to register multiple adlib loops. You just have to make sure you set the time parameter to a high enough value so you don't overload your computer. EX: While 1 If IsArray(PixelSearch(0, 0, 50, 50, 0xFF0000)) Then;dofunction If IsArray(PixelSearch(0, 0, 50, 50, 0x00FF00)) Then;dofunction If IsArray(PixelSearch(0, 0, 50, 50, 0x000FF0)) Then;dofunction If IsArray(PixelSearch(0, 0, 50, 50, 0x0000FF)) Then;dofunction WEnd This could be changed to: AdlibEnable("Adlib", 250) While 1 If IsArray(PixelSearch(0, 0, 50, 50, 0xFF0000)) Then;dofunction If IsArray(PixelSearch(0, 0, 50, 50, 0x00FF00)) Then;dofunction WEnd Func Adlib() If IsArray(PixelSearch(0, 0, 50, 50, 0x000FF0)) Then;dofunction If IsArray(PixelSearch(0, 0, 50, 50, 0x0000FF)) Then;dofunction EndFunc You can use adlibregister in the beta version using the same basic principles, just using more functions. 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