tymo93 0 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? Share this post Link to post Share on other sites
tymo93 0 Posted March 7, 2012 can I do it using ControlClick? :-? Share this post Link to post Share on other sites
ZWD40 0 Posted March 7, 2012 $var[2] = PixelSearch(-x1-, -y1-, -x2-, -y2-, -colors-) mouseclick("left", $var[0], $var[1]) Share this post Link to post Share on other sites
tymo93 0 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? Share this post Link to post Share on other sites
ZWD40 0 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 Share this post Link to post Share on other sites
tymo93 0 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. Share this post Link to post Share on other sites
Bert 1,430 Posted March 7, 2012 Would you post your code you are referencing from please? Thanks. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
tymo93 0 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. Share this post Link to post Share on other sites
Bert 1,430 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/ Share this post Link to post Share on other sites