I need help on autofocus script

Scripts and programs to automate Astroart
Post Reply
Brocke
Posts: 4
Joined: 22 Jan 2019, 20:09

I need help on autofocus script

Post by Brocke » 14 Apr 2020, 18:36

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

fabdev
Posts: 198
Joined: 03 Dec 2018, 21:43

Re: I need help on autofocus script

Post by fabdev » 14 Apr 2020, 19:06

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.

Brocke
Posts: 4
Joined: 22 Jan 2019, 20:09

Re: I need help on autofocus script

Post by Brocke » 15 Apr 2020, 17:55

Hello,

thank you for the tips.

I will do some tests next rainy day.

Dirk

Iver
Posts: 15
Joined: 08 Jan 2019, 04:32

Re: I need help on autofocus script

Post by Iver » 16 Apr 2020, 23:44

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!
Iver

Post Reply