user3k Posted December 13, 2010 Share Posted December 13, 2010 (edited) First yes, i'm a newbie. I'm using the folowing script to get coordinates: AutoItSetOption("MouseCoordMode", 2) AutoItSetOption("PixelCoordMode", 2) AutoItSetOption("SendKeyDelay", 250) Sleep (5000) $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) $var = PixelGetColor( $pos[0] , $pos[1] ) MsgBox(0,"The decmial color is", $var) MsgBox(0,"The hex color is", Hex($var, 6)) Let's say i get mouse coordinates 234, 278 and hex color FFFFFF Then I test using the following loop: AutoItSetOption("MouseCoordMode", 2) AutoItSetOption("PixelCoordMode", 2) AutoItSetOption("SendKeyDelay", 250 While True $PixelGetColor = Hex(PixelGetColor(234, 278), 6) If $PixelGetColor == "FFFFFF" Then ExitLoop WEnd But is not working. The color that i get appear to be correct. I think the mouse coordinate is not correlate with the coordinate needed for the PixelGetColor. How i get/calculate the right coordinate? Edited December 13, 2010 by user3k Link to comment Share on other sites More sharing options...
funkey Posted December 13, 2010 Share Posted December 13, 2010 (edited) Didn't saw your edit. Have a look onto the PixelCoordMode Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the window defined by hwnd (default active window): 0 = relative coords to the defined window 1 = absolute screen coordinates (default) 2 = relative coords to the client area of the defined window Opt("PixelCoordMode", ?) Edited December 13, 2010 by funkey Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Bert Posted December 13, 2010 Share Posted December 13, 2010 Using PixelGetColor in which I strongly suspect you want to click on something specific...that is something you should do only in a last resort. You should always try for a controlclick first. Much more stable. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Nitrolord Posted January 2, 2017 Share Posted January 2, 2017 (edited) I know this post is old but if your still wondering and for others who are still looking for the solution check out my post. Edited January 2, 2017 by Nitrolord Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 2, 2017 Moderators Share Posted January 2, 2017 @Nitrolord please don't resurrect old threads. Especially when the OP hasn't even been on the forum in 6 years. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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