Page 1 of 1

I need help on autofocus script

Posted: 14 Apr 2020, 18:36
by Brocke
Hello,

I slowly grawl deeper into the possibilities of Astroart.

I tried this script from User Iver (viewtopic.php?f=3&t=351) and it runs fine in simulation but can please somebody explain me this line:

if JD() - LastJD < .01255 then return '15 min = .0104166 20 min = .01255 25 min = .018 30 min = .021

What is JD? What does this line?

Thank you, stay healthy!
kind regards, Dirk

Re: I need help on autofocus script

Posted: 14 Apr 2020, 19:06
by fabdev
Hello, that was a trick to do a task every 20 minutes :

A day (JD) contains 1440 minutes, so for 20 minutes you could also write:

if JD() - LastJD < 20/1440 then ...

where LastJD is a variable that is written when the task if done. So:

Code: Select all

Sub Do_Something_Every_20_minutes 
  if JD() - LastJD < 20/1440 then return
  ...
  <do your task>
  ... 
  LastJD = JD()
End Sub
Now you can call the subroutine DoSomething whenever you want, with the guarantee that it will never do the task until other 20 minutes are passed. Remember to initialize LastJD at the beginning of the script, at 0 to do the task, or at JD() to skip.

Re: I need help on autofocus script

Posted: 15 Apr 2020, 17:55
by Brocke
Hello,

thank you for the tips.

I will do some tests next rainy day.

Dirk

Re: I need help on autofocus script

Posted: 16 Apr 2020, 23:44
by Iver
Hi Dirk, If you are using AA 7 with the latest service pack the sequence generator can help a lot with scripting. Once you set up the sequence if you go to menu you can select "Create similar script"
and then you only need to add a few custom commands to create your script!