Asked
— Edited

It seems like an easy thing to do but I cant quite seem to figure how to trigger a script at set intervals. For example if I want to run a re-calibration script every 30 minutes to home an encoder. I did this and put it in the personality generator but sometimes it will run the homing script a lot more then necessary.
Any advice is welcomed.
Code:
Try again
Code:
That should grab the current time, add on 30 minutes (or add on an hour then subtract 30 minutes if the minutes are above 30), if the hour equals 24 it resets to 0 (no need for anything greater since it will never get that far without resetting to 0) wait until the calculated time, execute your commands then loop back to the start.
It's crude and could be written better but I'm rushing
Code:
Or if 60000 is still too long a sleep
Code:
Both of those will use more processing than the WaitUntilTime() version but would allow the inclusion of a countdown timer until next execution or whatever.
Code:
Complete with countdown timer (and a good example of the use of the Floor() math function that's under used) and emulated display within the script window (if it is a stand alone script not in Script Manager, and the control not resized).
Change $SleepTimeInMinutes as required (Default is 30 minutes)
Add your code where indicated (Use ScriptStartWait to pause the countdown until after the commands have been run)
The rest is automatic.
Thanks again!
Just a note to say that your script to run a script at set timed interval works perfectly. You said it was a ruff and crude script but I don't see how you could have improved it. It runs every half hour exactly based on when I started ARC.
Now if I wanted to adjust the time frame what would I need to change?
The last one is just adjusting the first variable $sleeptime from 30 to however many minutes you want. The other scripts, find any reference to 30 and change it to however many minutes you want (up to an hour) I think, I'd have to check properly but should be leaving for work really!
Dont worrie. I'll get it figured out based on what you just stated. Get to work and have a good day. It's time for me to get to bed.
Code: