Jump to content

Click a Button by Color.


Recommended Posts

Yeah I know that... but I have another function which gets the color with PixerGetColor from a different x, y, Local $var = PixelGetColor(111, 174) and the result i use MsgBox(0, "The hex color is", Hex($var, 6)) and after this comes:

$var[2] = PixelSearch(-x1-, -y1-, -x2-, -y2-, -colors-)

mouseclick("left", $var[0], $var[1])

I replace -colors- with? I tried replacing it with Hex($var, 6) but nothing.

Link to comment
Share on other sites

Local $var = PixelGetColor(111, 174)
MsgBox(0, "The decimal color is", $var)
MsgBox(0, "The hex color is", Hex($var, 6))
Local $coord = PixelSearch(175, 148, 70, 70, Hex($var, 6))
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf

This is the whole code I am using. First I want to know if I got the right color before I click it, using MsgBox.

Link to comment
Share on other sites

I'm not confortable with this. I strongly suspect this is for something that is against this. No, you haven't said what this is for, but I see little reason to think otherwise.

Usually when I see a pixelsearch being used it is because the controller or item you want to click on isn't a normal controller. It is normally a picture or something that resist automantion and the range searched is very small. When using a large search area I know from experience this usually involves a game of some sort. Seeing how your search area is rather large, this simply strenghtens my belief that you are trying to automate a game of some type.

Care to explain what this is for?

Edited by MPH
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...