Sign in to follow this  
Followers 0
Unstoppable8900

The maximum one single loop can hold?

3 posts in this topic

Greetings. First off, let me get a few things clear. I own a server. I am wanting to automate a few things whilst I am asleep, mainly, detect if the server has crashed. I am somewhat new to auto it, but I have a semidecent automater working. Before, I had certain window checks in there own loops, but that broke things. Well, only the first loop would run, or the server crash loop would execute when it wasn't supposed to, etc. Now, I have things in one giant loop. Its a bit difficult to read, but, if it works, I guess it works. My question is, how much can one single loop take before the system or the script starts to lag? If I can find a previous version of the script with the window checks and loops divided evenly, I'll post it. The script is kinda long and not sure how to bring up the insert script with NVDA, my screen reader. Thank you everyone!

Share this post


Link to post
Share on other sites



 

My question is, how much can one single loop take before the system or the script starts to lag?

The limits of AutoIt are listed here.

The other limit is - as you have already noticed - readability. To keep the script well structured I suggest to put blocks of code (like checking for windows etc.) into a function and call this function fromt he main loop.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

In addition to what water said.

There are no explicit limits to loop size that I know of, however the problems you encountered with your original approach are down to human error. Loops do not run as and whenever willy-nilly. Crashing could be down to a number of things, but with long processes I suggest you use sleep to allow the processor to cool down every so often, especially if a process is meant to run for hours at a time.

Edited by czardas

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