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.
@Dave You can create a timer script to run in the background....
Thanks Richard but last time I tried to make a script sleep for a long time I couldn't get it to Sleep more then a minute or two. Cant remember how long it was but it wasn't very long. Maybe they changed that.
In a rush, I'll add more later if needed but look at the $hour and $minute variables and the WaitUntil() commands if you want to "sleep" for a long period
Damn, hit close before I hit post. Had just written a quick and nasty script for this.
Try again
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
I haven't tested long sleep intervals so you could very well be right, Dave... Maybe you could string a bunch of sleep commands of shorter intervals in a row to make up the 30 minutes? Not sure that will work either so maybe Rich has a better option for you....
Another alternative for long sleeps (if a long sleep command wont work) is a loop...
Or if 60000 is still too long a sleep
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.
@Rich... Actually, that's a really good option (a counter)...
To go one further, and to make it more complicated than it needs to be
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.