Jump to content

Howto write a func for pausing the script?


Recommended Posts

hi,

i´m try to write a func for pausing/resuming my script on hotkey.

pausing will work fine but unpausing not...

Here my funcs:

Func _UnPauseMe()
    $unpaused = 1
EndFunc

Func _PauseMe()
    $unpaused = 0
    HotKeySet("{PGDN}")  ;-> unregister hotkey for pausing
    HotKeySet("{END}", "_UnPauseMe")  ;-> register hotkey for pausing
    GUICtrlSetData($_status, "LaunchHelper is paused now...")
    While $unpaused <> 1
        Sleep(15000)
    WEnd
    GUICtrlSetData($_status, "LaunchHelper is resuming now...")
    HotKeySet("{PGDN}", "_PauseMe")  ;-> register hotkey for pausing
EndFunc

any hint to make it work?

Link to comment
Share on other sites

  • Moderators

hi,

i´m try to write a func for pausing/resuming my script on hotkey.

pausing will work fine but unpausing not...

Here my funcs:

Func _UnPauseMe()
    $unpaused = 1
EndFunc

Func _PauseMe()
    $unpaused = 0
    HotKeySet("{PGDN}") ;-> unregister hotkey for pausing
    HotKeySet("{END}", "_UnPauseMe") ;-> register hotkey for pausing
    GUICtrlSetData($_status, "LaunchHelper is paused now...")
    While $unpaused <> 1
        Sleep(15000)
    WEnd
    GUICtrlSetData($_status, "LaunchHelper is resuming now...")
    HotKeySet("{PGDN}", "_PauseMe") ;-> register hotkey for pausing
EndFunc

any hint to make it work?

There's an actual pause function written under HotKeySet() "_TogglePause()"

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...