Jump to content

Every 3rd day


TedEbear

Recommended Posts

I would use an integer variable. Set it to 0, and increment it by 1 every day at a given time (say 1 AM), and set the init value to the new value.

 

Then at whatever time you want something to happen, have another program that checks the current time AND if the variable is set to 3 or more. The if clause would take whatever action you want, and then set the variable (and init value) back to 0.

 

Then, given an example of something happening at 7 AM, the timeline would be:

 

Day1 - @1 AM - variable increments to 1

Day1 - @7 AM - variable is less then 3, program doesn't run

Day2 - @1 AM - variable increments to 2

Day2 - @7 AM - variable is less then 3, program doesn't run

Day3 - @1 AM - variable increments to 3

Day3 - @7 AM - variable is 3, program runs, resets to 0

Day4 - @1 AM - variable increments to 1

Day4 - @7 AM - variable is less then 3, program doesn't run

Day5 - @1 AM - variable increments to 2

Day5 - @7 AM - variable is less then 3, program doesn't run

Day6 - @1 AM - variable increments to 3

Day6 - @7 AM - variable is 3, program runs, resets to 0

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...