Jump to content

The maximum one single loop can hold?


Recommended Posts

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!

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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