Page 1 of 1

Schedule an script execution at a certain time

Posted: 27 Nov 2021, 17:36
by DortCe
Hi,

I have been writing a few scripts using the documentation in Astroart.

There is something that I have not found in the documentation, I'd like to schedule an script execution at a certain time, for example, 4am.

Is this possible?

Best Regards.

Re: Schedule an script execution at a certain time

Posted: 27 Nov 2021, 21:45
by fabdev
Hi,
it could be done with the function Time() or the function JD(), for example:

Code: Select all

sub WaitTime(s)
  while true
     if Mid(Time(), 1, 5) = s then break
     print Time() + " waiting..."
     Pause(1)
     Cls
  end while
end sub

WaitTime("04 00")
Instead of waiting for a given time, it can be more optimized to wait for a given altitude of the Sun. For example:
viewtopic.php?f=5&t=301

Re: Schedule an script execution at a certain time

Posted: 28 Nov 2021, 13:15
by DortCe
Thx a lot, that was very useful :)