Sign in to follow this  
Followers 0
pcjunki

pause just like batch script

3 posts in this topic

I'm trying to debug one of my scripts, and I was wondering if autoit has a "pause" function?

just like in .bat files

so it would be like...

Send("{TAB}{TAB}{TAB}{TAB}")
pause
ShellExecute("some more code")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

A blocking function like a MsgBox() would work.

Else using some sort of loop would be a more complicated way to do it but can be done with no on screen pop ups.

 

Send("{TAB 4}")
MsgBox(0, "", "Pause #1")
ShellExecute($vCode)

 

#Include <Misc.au3>

Send("{Tab 4}")
While 1
Sleep(10)
If _IsPressed("0D") Then ExitLoop ;Enter Key
WEnd

ShellExecute($vCode)

You could then convert the later into a function to reuse it easy.

#Include <Misc.au3>

MsgBox(0, "", "Start Script")
Pause()
MsgBox(0, "", "End Script")

Func Pause()
    While 1
        Sleep(10)
        If _IsPressed("0D") Then Return
    WEnd
EndFunc

 

Edited by ViciousXUSMC

Share this post


Link to post
Share on other sites

message box.. omg.. I can't believe I didn't think of that!

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