if you want to access the tables from another lua file, you need to either make them global (which is ugly) or create a namespace for them. you can use the frame if you want, or else any global table. for example
Code:
addon.table1 = {stuff}
which can then be accessed globally as [the frame's actual name].table1, without polluting the global namespace.
here's a simple function to output to the chat frame, if that's what you want to do:
Code:
local function cout(msg)
if(DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(msg, 0.0, 1.0, 0.0, 1.0)
end
end
your nil error means that one of your tables either has nil values or is shorter than expected. here's a bit more robust version
Code:
for i = 1,39 do
local lvlL, hL, locL = (tostring(lvl[i]) or "?"), (h[i] or "?"), (loc[i] or "?")
cout( ("%s, %s, %s."):format(lvlL, hL, locL) )
end