omgaghost Posted May 31, 2015 Share Posted May 31, 2015 (edited) Hello, I'm a brand new user, so please forgive me, I'm probably making some dumb mistake, I just can't see it.I want to hit the F12 button and have a tooltip come up telling me the current cursor X, Y & Color.I've been reading on PixelGetColor, and MouseGetPos, but I can't get what I tried to work, so I've dumbed my script down to be:Hit F12, have tool tip on screen. I can't even get that to work!HotKeySet("{F12}", _coords) While 1 WEnd Func _coords() ToolTip("This is a tooltip") Sleep(2000) ; Sleep to give tooltip time to display EndFuncI'm not sure why this isn't working. Any help is appreciated. Thanks! Edited May 31, 2015 by omgaghost Link to comment Share on other sites More sharing options...
iamtheky Posted May 31, 2015 Share Posted May 31, 2015 (edited) Here it is for F11.HotKeySet("{F11}", _coords) While 1 sleep(10) WEnd Func _coords() ToolTip("Position X: " & MouseGetPos()[0] & " -- Position Y: " & MouseGetPos()[1] & " -- Color: " & Hex(PixelGetColor(MouseGetPos()[0] , MouseGetPos()[1])) , 0 , 0) Sleep(2000) ; Sleep to give tooltip time to display EndFunc Help is your friend. The following hotkeys cannot be set: Ctrl+Alt+DeleteIt is reserved by WindowsF12It is also reserved by Windows, according to its API. Edited May 31, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
water Posted May 31, 2015 Share Posted May 31, 2015 I suggest to insert a Sleep command into your While loop. Else it will eat up all CPU cycles.While 1 Sleep(10) WEnd My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
omgaghost Posted May 31, 2015 Author Share Posted May 31, 2015 Thank You!I seriously never would of found that! I knew it was some dumb mistake!I've done a little script writing in AHK, and I've always used F12 with a little script to get cords, So I was pretty set on using F12 again!I'll just turn it into shift F11, since F11 does something else. Question about the While command with the sleep. A friend of mine turned me onto AutoIt over AHK, but the while command is new to me. Why is it necessary? Thanks Again! Link to comment Share on other sites More sharing options...
water Posted May 31, 2015 Share Posted May 31, 2015 Because without While/WEnd the script would end immediately. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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