Randomized schedule

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
GT2118
Newbie
Posts: 1
Joined: Tue Dec 24, 2013 11:49 pm

Randomized schedule

Post by GT2118 » Wed Dec 25, 2013 12:07 am

Presently, scheduling can be fixed to a time. It would be nice to have an additional option associated with a scheduled time, which would allow for some degree of randomization of execution centered on the scheduled time--a field to enter a time "window" (in minutes +/-) for randomizing execution.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Dec 27, 2013 10:28 am

This is actually quite easy to do with a regular schedule and two simple lines of code.

Let's say you want to run a schedule at 12:00 +/- 5 mins. Here's what you can do:

1. Modify the macro by adding these lines to the top:

Random>601,randDelay
Wait>randDelay

2. Schedule the macro to start at 11:55.

Now, what will happen is that the schedule will fire at 5 minutes to 12. The macro will then randomly decide a delay of between 0 and 600 seconds. I.e. somewhere between 0 and 10 minutes. It will wait that amount and then continue to do it's stuff.

The upshot is that you have a macro which runs sometime between 11.55 and 12.05.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts