Jump to content

wait for a key stroke


Guest zorro
 Share

Recommended Posts

Is it possible to pause the script until a specific key maniplulation is done?

I mean a script is paused until the user do CTRL $ , afterwards the script continues.

THX

Merry christmas

Z

Link to comment
Share on other sites

Is it possible to pause the script until a specific key maniplulation is done?

I mean a script is paused until the user do CTRL $ , afterwards the script continues.

THX

Merry christmas

Z

<{POST_SNAPBACK}>

:idiot: Hello this is a exampel for use a pause Toogle On/Off and Exit Script :D

I hope this help you.

Global $Paused

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

HotKeySet("{ESC}", "Terminate")

;;;; Body of program would go here;;;;

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

WinWait("Sacred","")

If Not WinActive("Sacred","") Then WinActivate("Sacred","")

WinWaitActive("Sacred","")

Sleep(100)

Send("Hello")

; ----------- Exit Program --------------

Func TogglePause()

$Paused = Not $Paused

While $Paused

Sleep(100)

ToolTip('Script is "Paused"', 0, 0)

Wend

ToolTip("")

EndFunc ;==>TogglePause

Func Terminate()

Exit 0

EndFunc ;==>Terminate

Edited by DirtyBanditos
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...