Invoking CEL and CELX - Scripts

All about writing scripts for Celestia in Lua and the .cel system
Topic author
wahuwa
Posts: 4
Joined: 20.10.2008
With us: 16 years 1 month

Invoking CEL and CELX - Scripts

Post #1by wahuwa » 21.10.2008, 14:09

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

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Re: Invoking CEL and CELX - Scripts

Post #2by Fenerit » 23.10.2008, 22:33

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)
Never at rest.
Massimo

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Invoking CEL and CELX - Scripts

Post #3by Vincent » 25.10.2008, 10:34

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.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
wahuwa
Posts: 4
Joined: 20.10.2008
With us: 16 years 1 month

Re: Invoking CEL and CELX - Scripts

Post #4by wahuwa » 29.10.2008, 14:18

I got it! It works fine!
Thanks to Fenerit and Vincent!


Return to “Scripting”