is possible to see all tables and ......

  • qwsdfghjmkmnhgfd
    7th Aug 2019 Member 0 Permalink

    im trying to find a way to print all tables and funtions is it possible?

  • LBPHacker
    7th Aug 2019 Developer 1 Permalink

    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()
  • qwsdfghjmkmnhgfd
    7th Aug 2019 Member 0 Permalink

    thanks