Unstoppable8900 Posted December 11, 2013 Share Posted December 11, 2013 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 More sharing options...
water Posted December 11, 2013 Share Posted December 11, 2013 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 - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
czardas Posted December 11, 2013 Share Posted December 11, 2013 (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 December 11, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now