Jump to content

How To Pause A Script


Recommended Posts

  • Developers

How I can set a HotKey to pause / resume a script?

Thanks

<{POST_SNAPBACK}>

Did you have a look at the helpfile ? it has an example for HotKeyset that just does what you are asking...

:ph34r:

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 post
Share on other sites

Yeah, here

Another single example, too...

HotKeySet("{PAUSE}", "_Pause"); PAUSE
HotKeySet("+{PAUSE}", "_UnPause"); SHIFT + PAUSE

ProgressOn( "Loop", "Progressing..", "", -1, -1, 16)
For $y=1 to 100
   $pauSet= $pauSet
   ProgressSet( $y, $y & '%', $pauSet)
   Sleep(500)
Next
Exit

Func _Pause()
   Global $pauSet= 1
   While $pauSet
   WEnd
EndFunc
 
 Func _UnPause()
   Global $pauSet= 0
EndFunc
Link to post
Share on other sites
Guest Malizia

I too have been attempting to use a pause/resume hotkey in my script. The script (which just outputs some text based on certain events on the screen) works fine in Notepad, and the hotkey pause/resumes as it should. However, when I run the computer game Final Fantasy XI (which I designed the script for) the hotkeys do not work. I have attempted to use Ctrl-x, the Pause key, and the End key as hotkeys. All work outside the game, none work inside the game. I'm guessing FFXI somehow disables the HotKeySet function from being activated, so is there a way around this? Except for the pause/resume hotkey thing, the script works perfectly in game.

Additionally, a friend of mine who has been attempting a similar thing mentioned that his GUI automation program has a pause/resume hotkey built into the program, instead of having to be written into a script. Does AutoIt have such a pause/resume hotkey built in?

Thanks,

Malizia

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...