Jump to content

Handling Indefinite Script Pause


Recommended Posts

Hello,

I am in a fix with this problem and I cant seem to find a viable solution. As you would know that the AutoIT scripts can go in pause mode for many reasons. It could be simply WinWait() that could take the script into that state. I do understand that a better design could help a lot but I would like to handle such situation with existing my code. To simplify my query - I am looking for a way to calculate how long the given script/compiled script has been in "pause"  state. Is there a way to do that?  For example, if my script has been in pause state for 3 hours I would like to kill or restart  the pc . I do understand that Auto IT is not multi-threaded but is there a way to achieve what I am trying to?

Any help or suggestion is much appreciated.

Thanks   

Link to comment
Share on other sites

35 minutes ago, 9252Survive said:

Hello,

I am in a fix with this problem and I cant seem to find a viable solution. As you would know that the AutoIT scripts can go in pause mode for many reasons. It could be simply WinWait() that could take the script into that state. I do understand that a better design could help a lot but I would like to handle such situation with existing my code.

Help us to help you: show your code.

Quote

_Timer_GetIdleTime

Returns the number of ticks since last user activity (i.e. KYBD/Mouse)

But a script thats frozen or loops endless can't act when a max is reached.  

Link to comment
Share on other sites

  • Moderators
1 hour ago, 9252Survive said:

I do understand that a better design could help a lot

@9252Survive You have answered your own question, I'm afraid. If you want to account for every possible scenario (WinWait, WinWaitActive, etc.) the responsibility will be on you the coder to do it correctly. Use the proper timeout parameters on each function for just this reason. Anything short of actually coding it correctly is, in the end, going to be a cobbled mess that causes you more issues.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

×
×
  • Create New...