Saving Memory
This chapter will show you some ways that large script projects can be fitted into the limited memory of our radios.
Telemetry Script Radios
-- Main telemetry script
local shared = { }
shared.screens = {
"/SCRIPTS/Test/menu1.lua",
"/SCRIPTS/Test/menu2.lua",
"/SCRIPTS/Test/menu3.lua"
}
function shared.changeScreen(delta)
shared.current = shared.current + delta
if shared.current > #shared.screens then
shared.current = 1
elseif shared.current < 1 then
shared.current = #shared.screens
end
local chunk = loadScript(shared.screens[shared.current])
chunk(shared)
end
local function init()
shared.current = 1
shared.changeScreen(0)
end
local function run(event)
shared.run(event)
end
return { run = run, init = init }Widget Script Radios
Last updated
Was this helpful?