Ultratech Posted February 24, 2007 Share Posted February 24, 2007 I'm just trying something simple for a function. How would I use sleep during a function until a key is pressed? I have a hotkey set to call the function, and in the function it follows a command then sleeps but I can't figure out the Do ... Until part. Any suggestions? Link to comment Share on other sites More sharing options...
Valuater Posted February 24, 2007 Share Posted February 24, 2007 yes.. show your script so we can help 8) Link to comment Share on other sites More sharing options...
BrettF Posted February 24, 2007 Share Posted February 24, 2007 yes.. show your script so we can help 8) Do Sleep (100) Until _IsPressed Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ultratech Posted February 24, 2007 Author Share Posted February 24, 2007 This is what I have so far #include <Misc.au3> HotkeySet("+t", "testfunc") While 1 Sleep(100) WEnd Func testfunc() Do ToolTip("Testing", 0, 0) Sleep(100) Until _IsPressed("45") EndFunc Trying to get it to exit the loop and resume While 1 when i press "e". Link to comment Share on other sites More sharing options...
BrettF Posted February 24, 2007 Share Posted February 24, 2007 This is what I have so far #include <Misc.au3> HotkeySet("+t", "testfunc") While 1 Sleep(100) WEnd Func testfunc() Do ToolTip("Testing", 0, 0) Sleep(100) Until _IsPressed("45") EndFuncoÝ÷ Ù:òx-¢Ûh{¶¥¢ZÚÞ²éZ¥{!zx©ë,ªê-z«¨·ú®¢×¢èZ½æ¥æÊÆ¢vØ^j{0z¶®¶sb6æ6ÇVFRfÇC´Ö62æS2fwC°¤÷D¶W6WBgV÷C²·BgV÷C²ÂgV÷C·FW7FgVæ2gV÷C²¥vÆR 6ÆVW¥tVæ@ ¤gVæ2FW7FgVæ2 Fð FööÅFgV÷CµFW7FærgV÷C²Â 6ÆVW VçFÂô5&W76VBCR FööÅFgV÷CµFW7FæröfbgV÷C²Â¤VæDgVæ2 I couldnt see anything wrong with it Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ultratech Posted February 24, 2007 Author Share Posted February 24, 2007 Yeah it works, but how do I use "e" key to exit the function. I want to get rid of the tooltip as well. I'm not sure if it exits the function or continues it, or it might be the While 1 Sleep, but the tooltip is still there. Link to comment Share on other sites More sharing options...
BrettF Posted February 24, 2007 Share Posted February 24, 2007 Yeah it works, but how do I use "e" key to exit the function. I want to get rid of the tooltip as well. I'm not sure if it exits the function or continues it, or it might be the While 1 Sleep, but the tooltip is still there. #include <Misc.au3> HotKeySet("+t", "testfunc") While 1 Sleep(100) WEnd Func testfunc() Do ToolTip("Testing", 0, 0) Sleep(100) Until _IsPressed(45) ToolTip("", 0, 0) EndFunc ;==>testfunc Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ultratech Posted February 24, 2007 Author Share Posted February 24, 2007 Works perfectly now. Thanks Link to comment Share on other sites More sharing options...
BrettF Posted February 24, 2007 Share Posted February 24, 2007 Works perfectly now. Thanks Glad to be of assistance... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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