vickerps Posted November 7, 2005 Share Posted November 7, 2005 I'm sure this is easy but my brain isn't working. I want a user to exit out of a loop if they press a certain key Link to comment Share on other sites More sharing options...
BigDod Posted November 7, 2005 Share Posted November 7, 2005 I'm sure this is easy but my brain isn't working.I want a user to exit out of a loop if they press a certain keyLookup HotKeySet in the help file. Remember to look at the example. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
vickerps Posted November 7, 2005 Author Share Posted November 7, 2005 Lookup HotKeySet in the help file. Remember to look at the example.I do know about hotkeys but doesn't do what i want. i only want to exit out of a loop not exitthis is the script im doing (maybe make things clearer)$SynchTimeComputer = PC99 DO SplashTexton ""," Waiting for " $SynchTimeComputer &@CRLF&@CRLF& "press esc to skip" $p = ping ($SynchTimeComputer) UNTIL $p > "0" Link to comment Share on other sites More sharing options...
t0ddie Posted November 7, 2005 Share Posted November 7, 2005 hotkeyset("{esc}","endloop") $x = 0 $SynchTimeComputer = PC99 DO SplashTexton ""," Waiting for " $SynchTimeComputer &@CRLF&@CRLF& "press esc to skip" $p = ping ($SynchTimeComputer) if $x = 1 then exitloop UNTIL $p > "0" func endloop() $x = 1 endfunc Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
BigDod Posted November 7, 2005 Share Posted November 7, 2005 #include <Misc.au3> $dll = DllOpen("user32.dll") $SynchTimeComputer = PC99 DO SplashTexton ""," Waiting for " $SynchTimeComputer &@CRLF&@CRLF& "press esc to skip" $p = ping ($SynchTimeComputer) UNTIL $p > "0" Or _IsPressed("1B", $dll) MsgBox(0, "Message", "Loop exited") Not tested Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
t0ddie Posted November 7, 2005 Share Posted November 7, 2005 thats just too much. simplicity is purity. stick with my example lol Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
BigDod Posted November 7, 2005 Share Posted November 7, 2005 thats just too much.simplicity is purity. stick with my example lolWhat he said but check your script for typo's. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
BigDod Posted November 7, 2005 Share Posted November 7, 2005 I like menI hope that means you are a female !!! Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
MHz Posted November 7, 2005 Share Posted November 7, 2005 I will try to be the 1st with some working code in this thread. HotKeySet('a', 'trigger') $a = 1 $b = 0 While $a = 1 Sleep(100) If stop() Then $a = 0 WEnd Func trigger() $b = 1 EndFunc Func stop() If $b = 1 Then Return 1 EndFunc The while loop will collapse when $b = 1 The trigger function through HotKetSet() will do this. 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