I have written a very long script automating some of my work, and I don't want help fixing it, so I won't post the whole thing, but I would like to ask a few general questions about what could cause an error. I started this only a month ago, but I've written at least 50,000 lines of code in AHK already. When I see an issue in the script, I immediately stop it and come up with a solution. However, about one in 50 times I run the script, it just bugs out.
For example, it seems to start on this section, where I send a random word from a list of options:
Code: Select all
Random, output, 49, 9999
Sleep, 10
Send % option%output%
Sleep, 10
Instead of sending one option, it sends four of them back-to-back. This isn't in a loop so I really don't understand it. I have all my entered data set to collect automatically into ini files so that I can access it if need be, and when this happens it writes the data 4 or 5 times instead of once.
So this is the stuff that is actually documented, the rest of the actions also seem wrong but the only verification is my seeing it with my eyes.
With this in mind, my questions are:
■ Does AHK just not work every time? Does it have a fail rate of less than 100%? Or...
■ Is the issue due to hardware being pushed too far? Because when I run the script, my computer is definitely being heavily used as far as CPU & memory go. Is it possible for AHK to fail if the hardware is being heavily used? For the record, I have put a Sleep command between every single line of code in the script.
■ Given a script doesn't have any errors, are there any other ways for it to fail internally (as opposed to interference from other processes, etc)?
And then specifically:
■ How could a command be repeated 4 times by mistake?
I am not just interested in fixing this specific issue, but in learning more about AHK in general.
EDIT: I resolved the issue that spurred this line of thinking, but I would still like to learn if it's possible for AHK to fail with flawless code, and what the reasons might be (the questions above).