Jump to content

Pause - Unpause


AlmarM
 Share

Recommended Posts

Heya,

I have some problems with Unpausing...

I know that pause is:

HotKeySet("{PAUSE}", "TogglePause")

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

But I can't unpause the script... Can someone help me ?

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

While you are in the function called by a HotKeySet(), additional HotKey events cannot interrupt it. You should change a flag or something else that can be done very fast, and get out of that function quickly. Make your HotKey functions very short and sweet (and alway include a way to quit):

Global $Paused = False

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "_Quit")

While 1
    If $Paused Then
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    Else
        ToolTip("")
    EndIf
WEnd

Func TogglePause()
    $Paused = Not $Paused
EndFunc   ;==>TogglePause

Func _Quit()
    Exit
EndFunc

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...