Miliardsto Posted October 29, 2016 Share Posted October 29, 2016 (edited) Hello i have problem with function PixelGetColor. On my computer it working fine but in some cases it not working. And Im clicking on the active window on red color and it give me the same color still. But in other computers when clicking on the same color red it gives other values and returned color in MsgBox is not red. Dont know is it a real main thing what causing problem but, I noticed that problem was on one windows 10. I have windows 8 and working well. On other windows 10 works well to Maybe it is caused by windows aero or something like that How to deal with it? There is a code HotKeySet("{PAUSE}", "MouseCord") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func MouseCord() Global $MousePos = MouseGetPos() $clickedColor = PixelGetColor($MousePos[0], $MousePos[1]) MsgBox(0, "Done", $clickedColor) EndFunc Edited November 10, 2016 by Miliardsto Link to comment Share on other sites More sharing options...
Miliardsto Posted October 30, 2016 Author Share Posted October 30, 2016 up. it worked on my friend windows 10. dont know what was causing that this function doesnt work Link to comment Share on other sites More sharing options...
Developers Jos Posted October 30, 2016 Developers Share Posted October 30, 2016 Is it returning the color of the point pointer as you are using that pixel? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Miliardsto Posted October 30, 2016 Author Share Posted October 30, 2016 1. Mouse move everythere u want 2. Press PAUSE/BREAK make call MouseCoord func 3. in $MousePos is stored color where mouse was when PAUSE/BREAK was pressed ------------------------ Returning Decimal color https://www.autoitscript.com/autoit3/docs/functions/PixelGetColor.htm Link to comment Share on other sites More sharing options...
Developers Jos Posted October 30, 2016 Developers Share Posted October 30, 2016 Yea fine but ... what is the answer to my question? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Miliardsto Posted October 30, 2016 Author Share Posted October 30, 2016 I dont know what your question exactly mean Link to comment Share on other sites More sharing options...
Developers Jos Posted October 30, 2016 Developers Share Posted October 30, 2016 If you take the position of the mousepointer and check for the pixel colour, isn't it than likely that it returns the colour of the mouspointer in stead of the color of the original pixel? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Miliardsto Posted October 30, 2016 Author Share Posted October 30, 2016 Just run the code below. if u click on white color it returns FFFFF if u click on blue it returns blue in rgb, red click returns nearing to FF0000. As I said in these computers where this function not working it returns always other color if u clicking the same color. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Timers.au3> #include <MsgBoxConstants.au3> #include <TabConstants.au3> #include <ColorConstants.au3> HotKeySet("{PAUSE}", "MouseCord") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func MouseCord() Global $MousePos = MouseGetPos() $clickedColor = Hex(PixelGetColor($MousePos[0], $MousePos[1])) MsgBox(0, "Done", $clickedColor) EndFunc Link to comment Share on other sites More sharing options...
AndyG Posted October 30, 2016 Share Posted October 30, 2016 Please make a screenshot and post it here! I think of problems with MouseCoordMode/ PixelCoordMode. Link to comment Share on other sites More sharing options...
Miliardsto Posted October 31, 2016 Author Share Posted October 31, 2016 in the top of my script is Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) there is no difference on my computer if it set to 1 or 0 if i click on red it gives me red Link to comment Share on other sites More sharing options...
AndyG Posted October 31, 2016 Share Posted October 31, 2016 Why don´t you post a screenshot? Link to comment Share on other sites More sharing options...
Miliardsto Posted October 31, 2016 Author Share Posted October 31, 2016 for what reason? what u want see. 10 screenshots when i click on the same position and it gives differents colors? Link to comment Share on other sites More sharing options...
Bert Posted November 1, 2016 Share Posted November 1, 2016 no - we want to see what app you are dealing with. There may be a better way to fix your problem. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
AndyG Posted November 1, 2016 Share Posted November 1, 2016 11 hours ago, Miliardsto said: for what reason? what u want see. 10 screenshots when i click on the same position and it gives differents colors? Yes! There IS a reason, and I want to see it! You asked for help and support us with...nothing. Waste our time is not very solution-oriented... Link to comment Share on other sites More sharing options...
Nitrolord Posted January 2, 2017 Share Posted January 2, 2017 (edited) Jos is correct it is returning the pixel at the very tip of your mouse pointer. problem solved here. Edited January 2, 2017 by Nitrolord Link to comment Share on other sites More sharing options...
Miliardsto Posted January 18, 2017 Author Share Posted January 18, 2017 lol . it not solve the problem. its not problem in 3 pixels right or down. cLICK ON THE same color - still same color - gives different colors Link to comment Share on other sites More sharing options...
Bert Posted January 18, 2017 Share Posted January 18, 2017 (edited) and Miliardsto refuses to give the name of the application. So, I have no choice but to assume it is for a game and that is against forum rules. Time to put up or stop. The name of the application you are wanting to automate please. Edited January 18, 2017 by Bert The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2017 Developers Share Posted January 18, 2017 52 minutes ago, Miliardsto said: lol . it not solve the problem. its not problem in 3 pixels right or down. cLICK ON THE same color - still same color - gives different colors I will do a *click* for this threat as it seems all important information is exchanged that you are willing to share. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts