Hello all! I have a script help request that I'm hoping those of you more versed than I can help with. Here is the use case:
I have a program that will time out and I need to be able for a script to press the spacebar at random intervals. Ideally somewhere between every 1-4 minutes it will just press the spacebar. It sounds simple in concept, but I'm finding the execution not working despite spending hours working on this.
I would appreciate any help! This program is amazing!
While I don’t think it is possible to do a calculation in a trigger(?), you could launch the Space-key macro periodically every 2 minutes or so, with a pause action with a randomized delay (calculated with one of those functions) before the actual Space-key pressing action.
Out of curiosity: Why has it to be random? Wouldn’t every 3 minutes (periodic trigger) work also?
thank you! In retrospect, you bring up a good point. It could be every 3 minutes. Random isn't necessary.
I found some areas on the forum, and I have started the following, but not sure where the error lies. I think it's with the Check Random Script macro and the environment variable. I think that may be the wrong action.
So I start with a script called: "Start Random Script"
thank you, KC! I do want to try and figure out if randomized intervals are possible (more because now I just want to see if it can be done). Any ideas? I set the nextExecutionTime variable to NOW()+random... then I have it do the check script - I think this is where my error lies. Thought is that if the now() is > nextExecutionTime then it needs to run the "run random script" which presses the key. If it's not, then it's not been long enough and it should wait until it is. I'm thinking there must be something wrong with that Check Random Script.... not sure if now() is considered an environment variable, and perhaps I have the wrong trigger selected.