Page 1 of 1

Inlcude and execute

Posted: 10.01.2005, 03:29
by manoweb
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

Re: Inlcude and execute

Posted: 10.01.2005, 09:57
by Harry
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

Posted: 10.01.2005, 11:15
by manoweb
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