Sign in to follow this  
Followers 0
XZ3R0

Pixelsearch with muliple outcomes?

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



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.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

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