civilcalc 0 Posted May 9, 2011 (edited) Hey peeps, I have an input box for a hex colour, and a button next to the input box for the 'set' function. I want to click the set button, then click somewhere on the screen and the colour under the cursor be returned for the Guictrlsetdata function to update the input box, but I cannot get it to work at all. Thanks in advance. PS I think I have cracked a full autoit OCR script (without external apps or dlls) , all will be revealed here soon! Edited May 9, 2011 by civilcalc Share this post Link to post Share on other sites
smartee 14 Posted May 9, 2011 hi,PS I think I have cracked a full autoit OCR scriptWhat do you mean "cracked"?-smartee Share this post Link to post Share on other sites
dufran3 0 Posted May 9, 2011 Can't you just use this to get the color under the mouse cursor? $MousePos = MouseGetPos() $PixelGetColor = Hex(PixelGetColor($MousePos[0], $MousePos[1]),6) Share this post Link to post Share on other sites
civilcalc 0 Posted May 9, 2011 hi, What do you mean "cracked"? -smartee As far as I am aware there isnt currently an autoit OCR script, that doesnt require any 3rd party applications or dlls. I believe I have made one. Can't you just use this to get the color under the mouse cursor? $MousePos = MouseGetPos() $PixelGetColor = Hex(PixelGetColor($MousePos[0], $MousePos[1]),6) Kind of, but I want that portion of script to occur when I click the mouse. Ive tried a while guigetmsg() loop, but it always returns 0 (no event) Share this post Link to post Share on other sites
dufran3 0 Posted May 9, 2011 (edited) As far as I am aware there isnt currently an autoit OCR script, that doesnt require any 3rd party applications or dlls. I believe I have made one. Kind of, but I want that portion of script to occur when I click the mouse. Ive tried a while guigetmsg() loop, but it always returns 0 (no event) Can you use this to try and read for mouse clicks? _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTDOWN) Edited May 9, 2011 by dufran3 Share this post Link to post Share on other sites
civilcalc 0 Posted May 9, 2011 Can you use this to try and read for mouse clicks? _WinAPI_Mouse_Event($MOUSEEVENTF_LEFTDOWN) I'll take a look, thanks Share this post Link to post Share on other sites
UEZ 1,278 Posted May 9, 2011 (edited) Try this cracker : #include <GUIConstantsEx.au3> #include <Misc.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Get Pixel Color", 289, 61, -1, -1, -1, $WS_EX_TOPMOST) $Label1 = GUICtrlCreateLabel("Color:", 32, 8, 39, 20, $SS_RIGHT) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Position:", 16, 32, 55, 20, $SS_RIGHT) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("Input1", 72, 8, 121, 21) $Button = GUICtrlCreateButton("Set", 208, 16, 75, 25) $Input2 = GUICtrlCreateInput("Input2", 72, 32, 121, 21) GUISetState(@SW_SHOW) $dll = DllOpen("user32.dll") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DllClose($dll) Exit Case $Button Do $aMpos = MouseGetPos() $color = PixelGetColor($aMpos[0], $aMpos[1]) $pos = $aMpos[0] & ", " & $aMpos[1] Until _IsPressed("01") GUICtrlSetData($Input1, "0x" & Hex($color, 6)) GUICtrlSetData($Input2, $pos) EndSwitch WEnd Br, UEZ Edited May 9, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
dufran3 0 Posted May 9, 2011 (edited) Damn, that is what I was looking for..._IsPressed....arrr What is the point of the .dll open? Edited May 9, 2011 by dufran3 Share this post Link to post Share on other sites