Sign in to follow this  
Followers 0
Guest zorro

wait for a key stroke

2 posts in this topic

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

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

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

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  
Followers 0