Recommended Posts

In a sequence:

private nexttime = floor(systime() / 86400) * 86400 + 8 * 3600
if (nexttime < systime())
   nexttime += 86400
endif
while (1)
   waituntil(nexttime)
   nexttime += 86400
   // do your stuff here
endwhile

floor(systime()/86400) * 86400 gets you midnight today. Add 8*3600 and you get 8am. Then we check to make sure its not 8am yet, and if it is, we add a day so we wait until tomorrow. The rest is just waiting and looping.

Link to comment
Share on other sites

Archived

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