thegreatconductor Posted March 18, 2004 Share Posted March 18, 2004 (edited) I need to setup my macro to run infinitely in a loop but then have a keypress abort the macro such as F10 so when the F10 key is hit the macro stops. Can anyone please help me with this? Thanks in advance for your help Edited March 18, 2004 by thegreatconductor Link to comment Share on other sites More sharing options...
scriptkitty Posted March 18, 2004 Share Posted March 18, 2004 This is a popular version. Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{F10}", "Terminate"); example F10 to exit HotKeySet("{ESC}", "Terminate") ; put in your script here Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip($paused&'Script is "Paused"',0,0) WEnd ToolTip($paused) EndFunc Func Terminate() Exit 0 EndFunc AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 18, 2004 Developers Share Posted March 18, 2004 Adapted version from the helpfile: HotKeySet("{F10}", "Terminate") ;;;; Body of program would go here;;;; While 1 ; do what you need to do in the loop Sleep(100) WEnd ;;;;;;;; Func Terminate() Exit 0 EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
CyberSlug Posted March 18, 2004 Share Posted March 18, 2004 Based on the example in the help file for HotKeySet: HotKeySet("{F10}", "Terminate") ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Terminate() Exit 0 EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Helge Posted March 18, 2004 Share Posted March 18, 2004 That's pretty easy actually... Just copy this code : HotKeySet("{F10}", "CLOSE") Func CLOSE() Exit EndFunc Good luck with your script ! Link to comment Share on other sites More sharing options...
Helge Posted March 18, 2004 Share Posted March 18, 2004 Seems like everybody was writing something at the same time her Link to comment Share on other sites More sharing options...
scriptkitty Posted March 18, 2004 Share Posted March 18, 2004 That is too funny, it was posted almost a half hour ago, and we all deside to post on it at the same time. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
CyberSlug Posted March 18, 2004 Share Posted March 18, 2004 That is too funny, it was posted almost a half hour ago, and we all deside to post on it at the same time. Actually, I'd say it's impressive that every post was informative instead of simply "RTFM." What a great community Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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