Jump to content
Sign in to follow this  

Help with HotKeySet and toggling

Recommended Posts

I'm trying to get a very simple endlessly looping action going that I can toggle paused and toggle unpaused, and terminate altogether, using hotkeys. As I barely know what I'm doing I started with the snippet example in the help file and this is my script below:

Global $Paused
HotKeySet("{^z}", "TogglePause")
HotKeySet("{^x}", "Terminate")
;;;; Body of program would go here ;;;;
While 1
Send ("^8")
Sleep (10000)

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
Func Terminate()
    Exit 0

As this is, the loop starts when I execute the script, and I can use CTRL-z to pause the script, but it doesn't unpause, and it's pretty much beyond me as to why.

Thanks for any pointers you might have

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...