run celx skript in background

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Dandelion
Posts: 8
Joined: 23.06.2009
With us: 15 years 4 months

run celx skript in background

Post #1by Dandelion » 23.06.2009, 17:26

Hi,

is it possible to have a celx script run in the background all the time doing some calculations and making an output now and then?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: run celx skript in background

Post #2by selden » 23.06.2009, 19:07

That should work, so long as the script calls wait() every few seconds.
If it doesn't give control to Celestia often enough (by calling wait) then Celestia will terminate it.
Selden

Topic author
Dandelion
Posts: 8
Joined: 23.06.2009
With us: 15 years 4 months

Re: run celx skript in background

Post #3by Dandelion » 24.06.2009, 13:01

So if the calculation takes to long Celestia would take over again?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: run celx skript in background

Post #4by selden » 24.06.2009, 18:22

That's right.

Also, only one Celx script can run at a time.
If you invoke another one (e.g. click on a script's icon) the one currently running will be terminated.
Selden


Return to “Scripting”