Need your help guys, I can't wrap my head around this one.
Basically, the task is.
in a certain area of a screen x1 y1 x2 y2, I need to click the object when the outline color appears while the mouse is moving/hovering to that area.
What is going on here is... THE THING needs the mouse to hover so that its outlines of the object will appear.
After it appears, then it will click on that object. The outline is a specific one, 1 color.
So what I think I need is.
1. Detection for a area x1 y1 x2 y2
2. The mouse will randomly move to that area and if detected the color it will click to that.
Hover object and if color detected click
Re: Hover object and if color detected click
I think that what you want is the color before the mouse hovers over it.
That's untested. Increase the sleep if it takes longer than that to highlight the object. You could also make it so that it waits until the highlight color is present, but that's more lines and this might be all that you really need.
Code: Select all
PixelSearch, pixelX, pixelY, x1, y1, x2, y2, 0x800080 ; The last parameter should be the color of the targeted pixel *before* it's been highlighted
MouseMove, pixelX, pixelY
Sleep, 250
Click
Re: Hover object and if color detected click
Yah I thought of that and actually using that method now. But the problem is it is not working efficiently. So I came up with the idea of why use the 1 color that is always present/visible everytime but the problem is I have to hover it to make it appear. Moreover, all the things that usually show the outline are the object that I would like to click.