address Posted February 24, 2012 Share Posted February 24, 2012 HotKeySet("{F2}", "huita") Func huita() $var = PixelGetColor() Local $pos = MouseGetPos() ConsoleWrite ($var & " " & $pos @crlf) ToolTip($var & " " & $pos) EndFunc While 1 Sleep(1000) WEnd Help please. Need to know coords and color of where mouse is when pressing F2 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2012 Moderators Share Posted February 24, 2012 address,Please use your brain a bit. - 1. What parameters does PixelGetColor take?x, y coordinates- 2. Do you provide them?No- 3. What gets returned by MouseGetPos?x, y coordinates- 4. Do you think they might be useful to PixelGetColor?YesNow go and reorder your code and you will soon get it to work. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
address Posted February 24, 2012 Author Share Posted February 24, 2012 HotKeySet("{F2}", "huita") Func huita() Local $pos = MouseGetPos() $var = PixelGetColor($pos) ConsoleWrite ($var & " " & $pos @crlf) ToolTip($var & " " & $pos) EndFunc While 1 Sleep(1000) WEnd Also not work. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2012 Moderators Share Posted February 24, 2012 address,Still not engaging that brain, are you? How are the coordinates returned from MouseGetPos?In an arrayAre you using the correct syntax to display the elements of the array?No - you need to use the index numbers: $pos[0], $pos[1]Keep at it - you are almost there. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
address Posted February 24, 2012 Author Share Posted February 24, 2012 Melba23 thank you Do you know, by any chance, why is 0 first in array? E.g. it gives in the right low corner 1023 767, which is incorrect. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2012 Moderators Share Posted February 24, 2012 address, Arrays in programming often start with the zero element - I believe it comes from the way some early computers addressed their memory space. They set aside a space in memory for the array with each element having a fixed size. Then the first element was to be found at the begining address of this space + (0 * size), the second at the beginning address + (1 * size), and so on. Hence the first element became [0]. As to the coordinates of the right bottom corner being 1023, 767 - that sounds about right to me. Remember that the vertical coordinate is 0 at the top and increases as you go down the screen. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Blinky Posted February 24, 2012 Share Posted February 24, 2012 hi u can find a nice example that does this and more in my 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