Checkin of sample scripts
parent
b836291557
commit
ad124da37c
|
@ -0,0 +1,8 @@
|
|||
jd = celestia:gettime()
|
||||
last = jd + 365
|
||||
|
||||
repeat
|
||||
jd = jd + 1.0
|
||||
celestia:settime(jd)
|
||||
wait(0.05)
|
||||
until jd >= last
|
|
@ -0,0 +1,18 @@
|
|||
function mark_spectraltype(x)
|
||||
local obs = celestia:getobserver()
|
||||
local nstars = celestia:getstarcount()
|
||||
local i = 0
|
||||
while i < nstars do
|
||||
star = celestia:getstar(i)
|
||||
first, last = string.find(star:spectraltype(), x, 1, true)
|
||||
if first == 1 then
|
||||
celestia:mark(star)
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
spectral = "O"
|
||||
celestia:flash("Marking all " .. spectral .. " stars.")
|
||||
mark_spectraltype(spectral)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
obs = celestia:getobserver()
|
||||
while 1 do
|
||||
nstars = celestia:getstarcount()
|
||||
index = math.floor(nstars * math.random())
|
||||
star = celestia:getstar(index)
|
||||
celestia:select(star)
|
||||
obs:goto(star, 10)
|
||||
wait(10)
|
||||
end
|
|
@ -0,0 +1,23 @@
|
|||
function goto(o, t)
|
||||
local obs = celestia:getobserver()
|
||||
obs:follow(o)
|
||||
obs:goto(o, t)
|
||||
while (obs:travelling()) do
|
||||
wait(0)
|
||||
end
|
||||
end
|
||||
|
||||
function visit(o)
|
||||
local i, v
|
||||
celestia:select(o)
|
||||
celestia:flash(o:type() .. " - " .. o:name())
|
||||
goto(o, 3)
|
||||
wait(0.5)
|
||||
local children = celestia:getchildren(o)
|
||||
for i, v in ipairs(children) do
|
||||
visit(v)
|
||||
end
|
||||
end
|
||||
|
||||
sol = celestia:find("Sol")
|
||||
visit(sol)
|
Loading…
Reference in New Issue