Inlcude and execute

All about writing scripts for Celestia in Lua and the .cel system
Topic author
manoweb
Posts: 8
Joined: 07.01.2005
With us: 19 years 10 months

Inlcude and execute

Post #1by manoweb » 10.01.2005, 03:29

Two quick question I couldn't find an answer. Is it possible to include an external file from a celx script? It would be very useful.

Is it also possible to execute an external command (like a video player) from a script?

Thank you
Alessio Sangalli

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: Inlcude and execute

Post #2by Harry » 10.01.2005, 09:57

manoweb wrote:Is it possible to include an external file from a celx script?
You can include other CELX-scripts by using the "dofile" command - check the Lua documentation for details.

In recent versions of Celestia you can also perform real I/O commands. You first have to request permission using celestia:requestsystemaccess, which will ask the user whether this should be allowed. After this you can use the Lua io & os libraries. Again see the Lua documentation for details.

Is it also possible to execute an external command (like a video player) from a script?

This too is possible with the method described above, but you'll likely have to do some tricks because the command blocks until the external command completes.

Harald

Topic author
manoweb
Posts: 8
Joined: 07.01.2005
With us: 19 years 10 months

Post #3by manoweb » 10.01.2005, 11:15

Thank you I'll check out those commands. And, I really want Celestia to stop while I show a video or a brief Impress presentation.
I'll post the results as soon as I implement them...

Thank you
Alessio Sangalli


Return to “Scripting”