civilcalc Posted May 9, 2011 Share 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 Link to comment Share on other sites More sharing options...
smartee Posted May 9, 2011 Share Posted May 9, 2011 hi,PS I think I have cracked a full autoit OCR scriptWhat do you mean "cracked"?-smartee Link to comment Share on other sites More sharing options...
dufran3 Posted May 9, 2011 Share 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) Link to comment Share on other sites More sharing options...
civilcalc Posted May 9, 2011 Author Share 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) Link to comment Share on other sites More sharing options...
dufran3 Posted May 9, 2011 Share 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 Link to comment Share on other sites More sharing options...
civilcalc Posted May 9, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
UEZ Posted May 9, 2011 Share 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
dufran3 Posted May 9, 2011 Share 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 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