Jump to content

Recommended Posts

Hello i have this litle script :

HotKeySet("{F8}", "_PauseScript")
Func _PauseScript()
    $Paused = NOT $Paused
    While $Paused
                $pause =  MsgBox(0, 'Pause', 'Script is paused')
        Sleep(100)
    WEnd
    ToolTip("")
EndFunc

Can you tell me how to make for show message 'Script is Paused"  when i press F8 and if OK is pressed on msgbox continue script.

Please help me

THX

Edited by Thebarbarius
Link to post
Share on other sites

Maybe something like this :

#include <MsgBoxConstants.au3>

HotKeySet("{ESC}", "_Terminate")
HotKeySet("{F8}", "_PauseScript")
Global $bPaused = False

; Main Loop
While 1
    Sleep(100)
WEnd

Func _PauseScript()
    $bPaused = True
    ToolTip("Script is paused", 10, 10)
    If MsgBox(0, 'Pause', 'Script is paused') = $IDOK Then
        $bPaused = False
        ToolTip("")
        Return
    EndIf
EndFunc   ;==>_PauseScript

Func _Terminate()
    Exit
EndFunc

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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...