Sign in to follow this  
Followers 0
bladerunner11

How to stop or pause the script?

4 posts in this topic

How do I use a F11 key to stop or pause my script without killing the processor under the windows task manager? Or is there a build-in function (keyboard key) that allows me to stop the script?

I am using a while loop to check my log files.

Here is an example:

while 1

; comment: I would like to use a key F11 keyboard key to stop or pause the script.

mycheck_log_func

wend

I would like to thank you for taking the time to read my post.

-Thanks in advance.

The_Runner

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

HotKeySet('{F11}', 'toggle')
HotKeySet('{Esc}', 'quit')

Local $pause

While 1
    ToolTip('Script is running')
    While $pause
        ToolTip('Script is paused')
        Sleep(50)
    WEnd
    Sleep(50)
WEnd

Func toggle()
    $pause = Not $pause
EndFunc

Func quit()
    Exit
EndFunc

edit - Oops, sorry Zedna, didn't mean to step on your post. I was typing. :)

Edited by xcal

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