Jump to content
Sign in to follow this  
9252Survive

Handling Indefinite Script Pause

Recommended Posts

9252Survive

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   

Share this post


Link to post
Share on other sites
AutoBert
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.  

Share this post


Link to post
Share on other sites
JLogan3o13
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.


√-1 2^3 ∑ π, and it was delicious!

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  

  • Similar Content

    • mar3011
      By mar3011
      hello, I want to set in the inputbox field random key from the keyboard to which the function will be assigned, for example F4 function start notepad ALT + A function start notepad for one function. Thank you for any help.  
    • JuanFelipe
      By JuanFelipe
      Cambiar a español Hello friends, I need help with a problem I have, I want to know if there is any way to update a GUI already running, that is I have a GUI of a certain size and with a button I would like to enlarge it:
      example: $ form1 = GUICreate ("", 200,100,0,0)   When you press the button, the gui increases its size, and actuates the new size.
    • BogdanNicolescu
      By BogdanNicolescu
      While 1 / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / WEnd OR:

       
      HotKeySet("{ESC}", "Terminate") While 1 MouseClick("Right",674,422) MouseClick("Left",673,447) Sleep(2000) / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / MouseClick("Left",675,339) SLeep(3000) WEnd Func Terminate()     Exit 0 EndFunc  
      Sorry if i should't let this here to be found by newbies like me -.-'
    • santoshM
      By santoshM
      Dear friends i am facing a problem , i have created a window in autoit some time it is moving with the mouse curser even if iam not clicking the window 
    • sumanth1980
      By sumanth1980
      Here i am wrote a simple lines to install basic applications but when i clicked on one application/program to install it was working fine but when i cancel the program in the middle to install another program it was not working. I am not an expert in this but i want a solution for this ... Can any one help me on this....
      ORG-1.au3
×