furian Posted February 14, 2019 Share Posted February 14, 2019 Hey all, I'm looking for a way to make this a little smarter. This while loops works almost like I want, except for one thing. I would like it to start over from the beginning if F6 is released, then held down again. While 1 if _IsPressed(75) then DoStuff1() EndIf if _IsPressed(75) then DoStuff2() EndIf if _IsPressed(75) then DoStuff3() EndIf Wend I tried the following, however, this will cycle through each function even if the F6 key is released midway, which I don't want. While 1 if _IsPressed(75) then DoStuff1() DoStuff2() DoStuff3() EndIf Wend Basically, if F6 is held down, begin cycling through the functions, however, if it is released, stop immediately. If it is pressed down again, start from the beginning. Any help is appreciated! Link to comment Share on other sites More sharing options...
Nine Posted February 14, 2019 Share Posted February 14, 2019 While 1 Sleep (50) ; reduce impact on CPU if not _IsPressed(75) then ContinueLoop DoStuff1() if not _IsPressed(75) then ContinueLoop DoStuff2() if not _IsPressed(75) then ContinueLoop DoStuff3() Wend “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
furian Posted February 14, 2019 Author Share Posted February 14, 2019 Thank you! I'm not sure I quite understand the "if not" part, but it does work! Link to comment Share on other sites More sharing options...
Nine Posted February 14, 2019 Share Posted February 14, 2019 7 minutes ago, furian said: Thank you! I'm not sure I quite understand the "if not" part, but it does work! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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