qwee Posted March 10, 2009 Share Posted March 10, 2009 Hi! I've searched but couldn't find anything of value Or it's just me that can't search for right things ^^ Well, need a code, so when I press ESC, the script will be paused, and when I press ESC again it'll be resumed! (Don't care if 1 button is for pause and 1 is for resume tbh) Fast plz! Link to comment Share on other sites More sharing options...
FireFox Posted March 10, 2009 Share Posted March 10, 2009 @gwee Nobody will make it at your place, and this has ben asked a milion of times... Search in this forum with Toggle Pause Cheers, FireFox. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 10, 2009 Share Posted March 10, 2009 If you want something done for you fast, then your best bet is to either: 1) Check if it has already been done. 2) Do it yourself. The help file is crammed with this kind of examples. I suggest looking for HotKeySet. github.com/jvanegmond Link to comment Share on other sites More sharing options...
SpookMeister Posted March 10, 2009 Share Posted March 10, 2009 As it is nearly time to go home... and I am feeling magnanimous... HotKeySet("{ESC}", "_Terminate") HotKeySet("{Pause}", "_Pause") While 1 Sleep(100) ; usually a good idea to put this in so you dont max your cpu ToolTip("Press ESC to quit") ; ; The stuff you want the script to do over and over again goes here ; WEnd Func _Terminate() Exit 0 EndFunc ;==>_Terminate Func _Pause() If Not IsDeclared("isPaused") Then Global $isPaused = False $isPaused = Not $isPaused While $isPaused Sleep(100) WEnd EndFunc ;==>_Pause [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
qwee Posted March 10, 2009 Author Share Posted March 10, 2009 As it is nearly time to go home... and I am feeling magnanimous... HotKeySet("{ESC}", "_Terminate") HotKeySet("{Pause}", "_Pause") While 1 Sleep(100) ; usually a good idea to put this in so you dont max your cpu ToolTip("Press ESC to quit") ; ; The stuff you want the script to do over and over again goes here ; WEnd Func _Terminate() Exit 0 EndFunc ;==>_Terminate Func _Pause() If Not IsDeclared("isPaused") Then Global $isPaused = False $isPaused = Not $isPaused While $isPaused Sleep(100) WEnd EndFunc ;==>_Pause Getting WEnd error. Got some "WHile"'s in the code! Link to comment Share on other sites More sharing options...
SpookMeister Posted March 11, 2009 Share Posted March 11, 2009 I was intended as a stand alone example... not to be cut and pasted in your code somewhere or vice versa... [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] 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