I'd like an explanation for both types, if possible.
I searched the forums before asking, and didn't find a satisfactory answer. Is it not possible?
What'd be really boffo is just knowing how to call a script at the end of another, and chain them together, then loop the whole thing again by having the last one call the first one.
How do I get scripts to loop?
Re: How do I get scripts to loop?
Size_Mick wrote:I'd like an explanation for both types, if possible.
For CEL: not at all (but see below)
For CELX:
Code: Select all
while true do
... script ...
end
Looping a CEL-script embedded in a CELX-script (not testest, just to give you the idea):
Code: Select all
while true do
celscript = celestia:createcelscript( [[
... CEL-script ...
]] )
while celscript:tick() do end
end
What'd be really boffo is just knowing how to call a script at the end of another, and chain them together, then loop the whole thing again by having the last one call the first one.
You can try using "dofile" in CELX, but it's probably better to combine both scripts in one, and then loop that.
Harald
I've tested this, and it works. Just had to add the wait command.
Code: Select all
while true do
celscript = celestia:createcelscript( [[
... CEL-script ...
]] )
while celscript:tick() do
wait(0)
end
end
I've tested this, and it works. Just had to add the wait command.
Code: Select all
while true do
celscript = celestia:createcelscript( [[
... CEL-script ...
]] )
while celscript:tick() do
wait(0)
end
end