tymo93 Posted March 7, 2012 Share Posted March 7, 2012 I want to click a button by a color I have specified how do I do this? Can anyone provide me with the line script that clicks a button with the color I set? Link to comment Share on other sites More sharing options...
tymo93 Posted March 7, 2012 Author Share Posted March 7, 2012 can I do it using ControlClick? :-? Link to comment Share on other sites More sharing options...
ZWD40 Posted March 7, 2012 Share Posted March 7, 2012 $var[2] = PixelSearch(-x1-, -y1-, -x2-, -y2-, -colors-) mouseclick("left", $var[0], $var[1]) Link to comment Share on other sites More sharing options...
tymo93 Posted March 7, 2012 Author Share Posted March 7, 2012 Yes, I found that myself as well !! Thanks anyway .. now I want to put the -colors- with a result from Hex($var, 6) that comes with a hex value :-? How do I do that? Link to comment Share on other sites More sharing options...
ZWD40 Posted March 7, 2012 Share Posted March 7, 2012 i dont understand that post lolIm assuming youre asking about the syntax for using the hex color code?0X(insert hex value here)0XFFFFFF <--white0XFF0000 <-red Link to comment Share on other sites More sharing options...
tymo93 Posted March 7, 2012 Author Share Posted March 7, 2012 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 More sharing options...
Bert Posted March 7, 2012 Share Posted March 7, 2012 Would you post your code you are referencing from please? Thanks. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
tymo93 Posted March 7, 2012 Author Share Posted March 7, 2012 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 More sharing options...
Bert Posted March 7, 2012 Share Posted March 7, 2012 (edited) 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 March 7, 2012 by MPH The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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