Sign in to follow this  
Followers 0
lawpapa

how to pause my script

6 posts in this topic

I would like to find a solution for pauseing my script by pressing a certain key on the keyboard

Does anyone know something about it ?

Pls dont recommend me the pause/break key. or tell me why it does not work by my comp ^^

Ty in advance

L.-

Share this post


Link to post
Share on other sites



I would like to find a solution for pauseing my script by pressing a certain key on the keyboard

Does anyone know something about it ?

Pls dont recommend me the pause/break key. or tell me why it does not work by my comp ^^

Ty in advance

L.-

Ok, how about we tell you to read the "Help" file under HotKeySet, and there is a perfect "Pause" example right there for the copying.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I would like to find a solution for pauseing my script by pressing a certain key on the keyboard

Does anyone know something about it ?

Pls dont recommend me the pause/break key. or tell me why it does not work by my comp ^^

Ty in advance

L.-

Look at the example for HotKeySet in the help files.

Edit - Great minds think alike!!!

Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

many thx guys B) sometimes i cant find things in help file :o

tx again

Share this post


Link to post
Share on other sites

I often use a twin combination of hotkey sets to do the pausing and resuming if I manually require to pause a script. If you think about it, pausing is only half of what you need, you'll also need to resume execution at some point.

You could always define a hotkey set which does the pausing. Chose a key combination that doesn't conflict with other applications that you might be running, say esc key (this will conflict with many other progs) i.e

somewhere at the beginning of the script

HotKeySet ( "{esc}" , "pauser" )

HotKeySet ( "{f1}" , "resumer" )

Global $var

somewhere in the execution of your script

Func pauser()

$var=0

while $var=0

sleep (250)

wend

endfunc

I haven't tested this but it might work.

and somewhere else something like

Func resumer()

$var=1

endfunc

Share this post


Link to post
Share on other sites

I often use a twin combination of hotkey sets to do the pausing and resuming if I manually require to pause a script. If you think about it, pausing is only half of what you need, you'll also need to resume execution at some point.

You could always define a hotkey set which does the pausing. Chose a key combination that doesn't conflict with other applications that you might be running, say esc key (this will conflict with many other progs) i.e

somewhere at the beginning of the script

HotKeySet ( "{esc}" , "pauser" )

HotKeySet ( "{f1}" , "resumer" )

Global $var

somewhere in the execution of your script

Func pauser()

$var=0

while $var=0

sleep (250)

wend

endfunc

I haven't tested this but it might work.

and somewhere else something like

Func resumer()

$var=1

endfunc

The example in the help file pauses and resumes.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

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  
Followers 0