Page 1 of 1

Invoking CEL and CELX - Scripts

Posted: 21.10.2008, 14:09
by wahuwa
Me: Newbee
OS: Windows XP SP3
Celestia: Version 1.5.1
Problem: I want Celestia to repeatedly execute scripts automatically time and again without interaction
Thread: Invoking CEL and CELX - Scripts
Question: Is there any possibility to invoke from a CELX script other CEL or CELX scripts and put them in a loop?
(e.g.: do while true
execute script1, script2 ...
end)
Is this the right way to resolve the problem? Or should I think of controlling Celestia from OS-Scripting (e.g. Batchfile)? But then I don't know how to give back control to the Batchfile from within Celestia script.
Hope having expressed myself clearly enough.
Thanks

Re: Invoking CEL and CELX - Scripts

Posted: 23.10.2008, 22:33
by Fenerit
For half your question (how to "invoke" a CEL from CELX), see here:

http://shatters.net/forum/viewtopic.php?f=9&t=12702 (the code sections)

Re: Invoking CEL and CELX - Scripts

Posted: 25.10.2008, 10:34
by Vincent
wahuwa wrote:Problem: I want Celestia to repeatedly execute scripts automatically time and again without interaction
Thread: Invoking CEL and CELX - Scripts
Question: Is there any possibility to invoke from a CELX script other CEL or CELX scripts and put them in a loop?
wahuwa,

The following lines allow you to launch one Celx script from within another:

Code: Select all

runscript = loadfile("script_filename")
runscript()

note: the script_filename path must refer to your celestia base folder.

Re: Invoking CEL and CELX - Scripts

Posted: 29.10.2008, 14:18
by wahuwa
I got it! It works fine!
Thanks to Fenerit and Vincent!