Jump to content
Sign in to follow this  
qwee

ESC = Pause Script (As .exe)

Recommended Posts

qwee

Hi!

I've searched but couldn't find anything of value :unsure: 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! :P

Share this post


Link to post
Share on other sites
FireFox

@gwee

Nobody will make it at your place, and this has ben asked a milion of times... :P

Search in this forum with Toggle Pause

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
jvanegmond

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.

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites
qwee

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!

Share this post


Link to post
Share on other sites
SpookMeister

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×