Jump to content

Pausing a script


Recommended Posts

Is there a way to pause a running script via hitting a key and allowing you to let it pickup where it left off by hitting another key? Is that some major coding feat or is there a simple pause cmd that I am just not seeing in the docs.

Thanks

Loraik

Link to comment
Share on other sites

Is there a way to pause a running script via hitting a key and allowing you to let it pickup where it left off by hitting another key?  Is that some major coding feat or is there a simple pause cmd that I am just not seeing in the docs.

Thanks

Loraik

<{POST_SNAPBACK}>

Try an AdLib function and a toggle function.

Dim $pause = 0
HotKeySet("{pause}","PauseIt")
AdLibEnable("_IsPaused",250)
.
.
.

Func PauseIt(ByRef $pause)
   If $pause = 0 then $pause = 1
   If $pause = 1 then $pause = 0
EndFunc

Func _IsPaused(ByRef $pause)
   If $pause = 1 then
      Do
         Sleep(50)
      Until $pause = 0
   EndIf
EndFunc

This code is untested, and may not work as expected. This was just out of the top of my head.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

It's already built in .. all you need to do is click on the icon in the system tray! This will pause your script - and to un-pause it, just un-check the "Paused" option.

Couldn't be simpler :)

Link to comment
Share on other sites

It's already built in .. all you need to do is click on the icon in the system tray! This will pause your script - and to un-pause it, just un-check the "Paused" option.

Couldn't be simpler  :)

<{POST_SNAPBACK}>

True, but in some fullscreen applications (such as City of Heros) one cannot alt-tab out, and one cannot summon the toolbar/tray to click the icon. Some form of anti-cheat to keep people from running bots or scripts. Doesn't stop me...I just use a hotkey to keep my scripts paused (in a sleep(500) loop) until I need them.

In this case, one would have to simulate a control click to the tray on the correct icon. I honestly don't know if it's possible to do this in a fullscreen app.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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...