Jump to content
Sign in to follow this  
Omar

Reset / Interrupt Script function?

Recommended Posts

Omar

Is there any way to put a universal reset or interrupt into a script besides function calls every line? I'm looking to break loops on a given command or keystroke.

Share this post


Link to post
Share on other sites
Richard Robertson

I've never heard of such a thing. I doubt it would be plausible due to the need to check every line anyways. You will most likely have to do it yourself. I suggest an automation of those lines being inserted.

Share this post


Link to post
Share on other sites
Omar

I've never heard of such a thing. I doubt it would be plausible due to the need to check every line anyways. You will most likely have to do it yourself. I suggest an automation of those lines being inserted.

Alright thanks i was afraid of that.

Share this post


Link to post
Share on other sites
Valuater

do you mean like this ???

; Press Esc to terminate script, [color="#ffffff"]Pause[/color]/Break to "[color="#ffffff"]pause[/color]"

Global $Paused
HotKeySet("{[color="#ffffff"]PAUSE[/color]}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")   ;Shift-Alt-d

;;;; Body of  program would go here ;;;;
While  1
    Sleep(100)
WEnd
;;;;;;;;

Func  TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is  "Paused"',0,0)
    WEnd
     ToolTip("")
EndFunc

Func  Terminate()
    Exit 0
EndFunc

Func  ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Omar

do you mean like this ???

; Press Esc to terminate script, [color="#ffffff"]Pause[/color]/Break to "[color="#ffffff"]pause[/color]"

Global $Paused
HotKeySet("{[color="#ffffff"]PAUSE[/color]}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")   ;Shift-Alt-d

;;;; Body of  program would go here ;;;;
While  1
    Sleep(100)
WEnd
;;;;;;;;

Func  TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is  "Paused"',0,0)
    WEnd
     ToolTip("")
EndFunc

Func  Terminate()
    Exit 0
EndFunc

Func  ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc
oÝ÷ ÛÏêº^²í¡ú'¶«m¶¶»­#¬¶§)àÞ¡öºÚ"µÍÎÎÎÈÙHÙÙÜ[HÛÝ[ÛÈHÎÎÎÂÚ[HH    ÌÍÛ[HHÛÝ[

BÑ[ÎÎÎÎÎÎÎÂ[ÈÛÝ[

BÚ[HH  ÈLÌÍÚHH ÌÍÚH
ÈBÔ[ÛH[ÈÙÛÙWBÙ[[[Â

Of course this is an extremely easy example but what I would like to see happen is a hotkey to interrupt the function in progress, and resume back to the while loop in the body while the while loop in the function is running. I know i could do checks between each line of code but I was looking for something else that may be easier, which probably doesn't exist.

thanks for the responses.

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  

×