This is a very minimal script that tries to display a cel//url every 5 seconds
(installed in celestia/extras/defil an run together with lua_plugins)
Code: Select all
local t, t0 =0,0
local vue = 1
local cels={}
local active = false
defil = CXBox:new()
:init(0, 0, 0, 0)
:movable(false)
:attach(screenBox,0, 0, 0, 0)
defil.Customdraw = function(this)
if not active then return end
t=celestia:getscripttime()
if t - t0>= 5 then
celestia:print("celURL #"..vue,5)
celestia:seturl(cels[vue]) -- <== problem here
vue = vue % #cels + 1
t0=t
end
end
local toggleDefil = function ()
active = not active
if active
then celestia:print("defil active",4)
else celestia:print("defil inactive",4)
end
end
keymap["d"] = toggleDefil
-- 20 cel://urls as example
cels = {
"cel://SyncOrbit/Sol:Earth/2004-05-20T22:25:58.53762?x=SFWD6wim9P///////////w&y=Tqej4HXdbQ&z=hRnrmF2p/f///////////w&ow=-0.404799&ox=0.397894&oy=0.584917&oz=-0.579387&track=Polaris&select=HIP%2053612&fov=84.8542&ts=1000<d=0&p=0&rf=1183&lm=2&tsrc=0&ver=3",
"cel://Chase/Sol:Earth:ISS/2003-08-19T01:54:43.50915?x=du/YfyI&y=uEV39vP//////////////w&z=R+JBy/T//////////////w&ow=0.143802&ox=0.672601&oy=-0.440693&oz=0.576817&select=Sol:Earth:ISS&fov=68.3125&ts=100<d=0&p=0&rf=40855&lm=49152&tsrc=0&ver=3",
"cel://Follow/Sol:Earth/2003-09-08T17:06:17.48057?x=gCtfeVwmef3//////////w&y=RtNTaKftPQ&z=EDhTrlarM////////////w&ow=0.583109&ox=0.211381&oy=0.778011&oz=-0.1&select=Sol:Earth&fov=23.221&ts=10000<d=0&p=0&rf=2711&lm=49152&tsrc=0&ver=3",
"cel://Follow/Sol:Earth/2005-04-16T07:10:22.54873?x=AABBcLjv2dfq/////////w&y=AADAgi1CKH64&z=AAAEh/hxw663/////////w&ow=0.365811&ox=0.459924&oy=0.685501&oz=0.429815&select=Sol:Earth&fov=25.746&ts=1e+006<d=0&p=0&rf=2083&lm=49154&tsrc=0&ver=3",
"cel://Follow/Sol/2248-10-10T06:03:10.05316?x=AACqn72DO3oV&y=AABYwLMdOLQv&z=AAB4qjfrA4B4/////////w&ow=-0.101865&ox=-0.199312&oy=0.95808&oz=0.178833&select=Sol&fov=50.9753&ts=1e+006<d=0&p=0&rf=2083&lm=49154&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol:Earth:Moon/2003-08-01T22:45:20.15578?x=wYt0jpERrv///////////w&y=rCFi/fU8wv///////////w&z=9rpP6PR3Cw&ow=-0.444334&ox=0.559807&oy=-0.429046&oz=-0.552361&select=Sol:Earth:Moon&fov=1.18416&ts=100000<d=0&p=0&rf=2711&lm=49152&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol/2007-08-28T07:19:24.20184?x=mS11i+DC5uT//////////w&y=cVpm17uEAg&z=reVJUMG++f///////////w&ow=-0.375458&ox=0.599217&oy=-0.376007&oz=-0.598823&select=Sol:Earth:Moon&fov=1.59564&ts=1000<d=0&p=0&rf=35735&lm=49156&tsrc=0&ver=3",
"cel://Chase/Sol:Earth:Moon/2003-09-29T08:51:07.62031?x=Uyjq5huI7P///////////w&y=LC8yE/gXwf///////////w&z=wXHD5NwC8////////////w&ow=-0.0200548&ox=-0.0247442&oy=-0.730913&oz=0.681727&select=Sol:Earth:Moon&fov=25&ts=10000<d=0&p=0&rf=2711&lm=49152&tsrc=0&ver=3",
"cel://Follow/Sol:Earth:ISS/2004-01-21T20:41:12.64836?x=s5OF1BL3/////////////w&y=c8Nu6P///////////////w&z=56h00DLx/////////////w&ow=-0.222393&ox=-0.537671&oy=-0.799421&oz=0.149589&select=Sol:Earth:ISS&fov=0.47917&ts=50<d=0&p=0&rf=68503&lm=49158&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth:ISS/Sol/2004-01-21T23:37:53.97263?x=R2EUAVr5/////////////w&y=NjH+/////////////////w&z=ayY&ow=0.195459&ox=0.679555&oy=0.195459&oz=-0.679555&select=Sol&fov=1.97233&ts=1<d=0&p=0&rf=2967&lm=49152&tsrc=0&ver=3",
"cel://Follow/Sol:4179%20Toutatis/2004-09-28T15:54:49.07196?x=zPLWywr1/////////////w&y=KbVfW5X4/////////////w&z=NBof6L0D&ow=0.031327&ox=-0.354344&oy=-0.430295&oz=0.829642&select=Sol:Earth&fov=45&ts=1<d=0&p=0&rf=6419&lm=2&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol/1210-09-17T10:22:54.77193?x=p4K24FEoAw&y=V83S3Hfo3P///////////w&z=7aCWGHF6JQ&ow=-0.471689&ox=0.581909&oy=-0.413836&oz=-0.517331&select=Sol:Venus&fov=0.013397&ts=100<d=0&p=0&rf=-1374118629&lm=-1074932214&tsrc=0&ver=3",
"cel://Follow/Sol:Earth/1278-08-25T14:18:46.02806?x=IwKRXRTAHg&y=OJaHU0wEEA&z=RMdeXkkA2v///////////w&ow=0.752377&ox=0.116945&oy=-0.62964&oz=0.154291&fov=0.00181&ts=10<d=0&p=0&rf=-1374118629&lm=-1074932214&tsrc=0&ver=3",
"cel://SyncOrbit/Sol:Halley/2061-05-06T20:28:19.92988?x=E6TuFVsI8I8C&y=brSnVTLgze///////////w&z=uSdcVsqxg73//////////w&ow=-0.137349&ox=0.72066&oy=0.103172&oz=0.67167&select=Sol:Halley&fov=37.5174&ts=1<d=0&p=0&rf=56215&lm=0&tsrc=0&ver=3",
"cel://SyncOrbit/Sol:Earth:Moon/2004-06-23T19:52:30.92834?x=+27lgqIHblz3/////////w&y=WfJm2OOgjvI&z=1BAHJktwZPr+/////////w&ow=-0.58167&ox=-0.430518&oy=-0.610773&oz=0.321356&select=Sol:Earth&fov=0.004361&ts=1e-006<d=0&p=0&rf=40839&lm=128&tsrc=0&ver=3",
"cel://Freeflight/2008-12-26T09:58:24.56973?x=4HoVmJ8+r5dw/////////w&y=v7MVGG59MREF&z=SRjzNPMvwkTb/////////w&ow=0.107477&ox=0.615451&oy=-0.775227&oz=0.093236&track=Sol:Saturn:Pandora&fov=35.5732&ts=5000<d=0&p=0&rf=57239&lm=0&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol:Earth:Moon/2008-12-17T11:11:14.36992?x=6poN1OkvEA&y=Ni6RP1xf8P///////////w&z=tnnv4cQuJg&ow=-0.389271&ox=0.590092&oy=-0.379906&oz=-0.596599&select=Sol:Earth&fov=0.796068&ts=1e+006<d=0&p=0&rf=-1374102141&lm=-1074933760&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol:Earth:Moon/2009-03-25T01:54:36.94363?x=lJrsmQ2xsw0&y=nn7rgtUiFg&z=BN4r7yOiAg&ow=0.378681&ox=-0.589507&oy=-0.388309&oz=-0.59858&select=Sol:Earth&fov=3.25781&ts=200000<d=0&p=0&rf=-1407656557&lm=-1074933760&tsrc=0&ver=3",
"cel://PhaseLock/Sol:Earth/Sol:Earth:Moon/2006-07-08T11:09:50.17267?x=dRI6S2P4EAs&y=eVSlzzyTDg&z=sBKGt5WZBw&ow=0.36545&ox=-0.537889&oy=-0.404679&oz=-0.642928&select=Sol:Earth:Moon&fov=35.5795&ts=100000<d=0&p=0&rf=-1407656557&lm=-1074933760&tsrc=0&ver=3",
"cel://SyncOrbit/Sol:Earth:Moon/2009-01-29T17:03:42.69730?x=lLfOceENAg&y=jwUn0whyAg&z=mn5FNeJk9P///////////w&ow=-0.553858&ox=-0.451806&oy=-0.54706&oz=0.435704&select=Sol:Earth&fov=23.8374&ts=200000<d=0&p=0&rf=-1407656557&lm=-1074933760&tsrc=0&ver=3",
}
The left upper overlay shows that the seturl command is launched as expected every 5 seconds but is not displayed properly.
The screen remains black and the distance is weird.
This problem doesn't occur in celx scripts nor in lua scripts when the seturl command is called from a keystroke or a mouse click.