Example widget:
Code: Select all
function widget:GetInfo()
return {
name = "*GETMEMORYUSAGE",
desc = "Tries to print ram usage",
author = "Beherith",
date = "2021 Sept",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true -- loaded by default?
}
end
local BigTable = {1,2,3,4}
local IWantThisOne = true
function widget:Initialize()
local IDontWantThisOne = true
end
function widget:GameFrame()
BigTable[ #BigTable + 1 ] = #BigTable
local ThisVariableActualllyGetsFoundByGetLocal = true
while true do
local i = 1
local n, v = debug.getlocal(1, i)
if not n then break end
Spring.Echo(n)
i = i+1
end
end
EDIT: I have tried sifting recursively through all the variables returned by debug.getlocal at both stack levels 1 and 2, but BigTable is never in it