im trying to find a way to print all tables and funtions is it possible?
Run this with dofile("path/to/thing.lua"), it'll dump your environment into env.log.
local handle = io.open("env.log", "w")
local function dumpt(tbl, tracker, lev)
if tracker[tbl] then
handle:write("see above")
return
end
tracker[tbl] = true
for key, value in pairs(tbl) do
handle:write("\n" .. lev .. key .. " = ")
if type(value) == "string" then
handle:write("\"" .. value .. "\"")
elseif type(value) == "table" then
dumpt(value, tracker, lev .. "\t")
else
handle:write(tostring(value))
end
end
end
dumpt(_G, {}, "")
handle:close()
thanks