Knee 0 Posted October 22, 2014 (edited) Function: • Save color of pixel at center • Compare a constantly updated pixel with original pixel • Print message if original pixel is different than new one • Exit when hotkey is pressed Problem: • Hot keys have no effect • It doesn't even read the first msg box from firing the hotkey for "fire" #include <Misc.au3> #include <MsgBoxConstants.au3> $toggle = 1 $start = 1 HotKeySet ( "F7" , "fire" ) HotKeySet ( "F8", "On_Exit" ) While True Sleep(10) WEnd Func fire() MsgBox($MB_SYSTEMMODAL, "success", "yay", 3) $color = PixelGetColor(@DesktopWidth / 2, @DesktopHeight / 2) While True $color1 = PixelGetColor(@DesktopWidth / 2, @DesktopHeight / 2) If Not $color == $color1 Then MsgBox($MB_SYSTEMMODAL, "yay", "yay", 3) Sleep(500) EndIf Sleep(50) WEnd EndFunc Func On_Exit() Exit EndFunc Edited October 22, 2014 by Knee Share this post Link to post Share on other sites
kylomas 415 Posted October 22, 2014 knee,The format of the key is wrong for HotKeySet...see Helpfile Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
Knee 0 Posted October 22, 2014 (edited) I've looked at the help file and some examples and they all use the same format i.e. HotKeySet ( hotkey , function name ) Else, I'm not sure what you mean. I've checked with other keys, they work, just not the function keys. :s ------------------------------------------------------ aha, now I see it, F7 ---> f+7 (i think) instead of using {F7} ---> {F7} Edited October 22, 2014 by Knee Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 22, 2014 "{F7}" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Bert 1,427 Posted October 22, 2014 Knee, this is the same script you are using for a game. Reported. The Vollatran project _____ I'm famous My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
Melba23 3,396 Posted October 22, 2014 Knee,Please read the comment I made in your >other thread. 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 Share this post Link to post Share on other sites