anyday Posted August 2, 2006 Share Posted August 2, 2006 hey guys, been awhile since i last posted here. was gonna see if it was possible to hold exec of the script until the color under the mouse was at a certain hex ? like if i set the mouse pos on the screen and the script had to wait until the RGB hex of that area was a set hex before script continued? Link to comment Share on other sites More sharing options...
Paulie Posted August 2, 2006 Share Posted August 2, 2006 (edited) hey guys, been awhile since i last posted here. was gonna see if it was possible to hold exec of the script until the color under the mouse was at a certain hex ? like if i set the mouse pos on the screen and the script had to wait until the RGB hex of that area was a set hex before script continued? Get the mouse position then check the color While 1 $pos = MouseGetPos $Color = PixelGetColor($pos[0], $pos[1]) If $color = *Your Color* then ;Do Whatever Endif Wend EDIT: Of course this is for the decimal of a color, not hex, not sure how to get hex out of a PixelGetColor Edited August 2, 2006 by Paulie Link to comment Share on other sites More sharing options...
win2k Posted August 2, 2006 Share Posted August 2, 2006 Hmmm someone wrote this block to play a game where a ball bounces around the screen and the mouse moves with it. might help While 1 $a = MouseGetPos() If Not @error Then $b = PixelSearch($a[0] - 80,$a[1] - 50,$a[0] + 80,$a[1] + 50,0xA7FF92) If Not @error Then MouseMove($b[0],$b[1],0) Else $b = PixelSearch($a[0] - 80,$a[1] - 50,$a[0] + 80,$a[1] + 50,0xEBFFE7) If Not @error Then MouseMove($b[0],$b[1],0) EndIf EndIf Sleep(0) WEnd Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 2, 2006 Moderators Share Posted August 2, 2006 Opt('MouseCoordMode', 2) Opt('PixelCoordMode', 2) While 1 Sleep(10) $aMpos = MouseGetPos() $HexPix = '0x' & Hex(PixelGetColor($aMpos[0], $aMpos[1]), 6) ToolTip('Hex Color = ' & $HexPix & @CR & _ 'Client X:Y = ' & $aMpos[0] & ',' & _ $aMpos[1], $aMpos[0] + 20, $aMpos[1] + 20) WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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