--[[ Created By Quren (Discord: fuckyougitler) ]] function readTable(tbl, saveToFile, forcedPrint, tblName) maxLines = 500 -- Maximum output (without saving the file) is <<500>> lines with all existing lines stay in console. tblName = tblName or "UnNamed" local buffer = {} local function generateOutput(tbl, prefix) if type(tbl) ~= "table" then table.insert(buffer, {type = 'print', text = "Value: " .. tostring(tbl)}) return end prefix = prefix or "" local numValueKeys, otherValueKeys, tableKeys = {}, {}, {} for k, v in pairs(tbl) do if type(v) == "table" then table.insert(tableKeys, k) elseif type(k) == "number" then table.insert(numValueKeys, k) else table.insert(otherValueKeys, k) end end table.sort(numValueKeys) -- numbers sort table.sort(otherValueKeys) -- letters sort table.sort(tableKeys, function(a, b) return tostring(a) < tostring(b) end) -- tables sort local sortedKeys = {} for _, k in ipairs(numValueKeys) do table.insert(sortedKeys, k) end for _, k in ipairs(otherValueKeys) do table.insert(sortedKeys, k) end for _, k in ipairs(tableKeys) do table.insert(sortedKeys, k) end for i, key in ipairs(sortedKeys) do local value = tbl[key] local isLast = (i == #sortedKeys) local isTable = type(value) == "table" local branch = isTable and "└── " or "┃ " local line = prefix .. branch .. '"' .. tostring(key) .. '"' if isTable then line = prefix .. branch .. tostring(key) table.insert(buffer, {type = 'warn', text = line}) local newPrefix = prefix .. (isLast and " " or "╲ ") generateOutput(value, newPrefix) else local formattedLine = string.format("%s | %s | (%s)", line, tostring(value), typeof(value)) table.insert(buffer, {type = 'print', text = formattedLine}) end task.wait() end end local t = os.clock() print("\n\n//--- Reading '" .. tblName .. "' Table..") generateOutput(tbl, prefix or " ") print("//--- Table read in", os.clock() - t, "!") local function printAll() warn("//----------- ", tblName) for _, entry in ipairs(buffer) do if entry.type == 'warn' then warn(entry.text) else print(entry.text) end task.wait() end warn("//-------------------------------------------------------------------------------------------------------------------------\n\n") end if #buffer > maxLines or saveToFile then if makefolder and isfile and writefile then local content = {} for _, entry in ipairs(buffer) do table.insert(content, entry.text) end local extension = ".txt" local counter = 0 local fileName = string.format("%s.txt", tblName) makefolder("./ReadTable") while isfile("./ReadTable/" .. fileName) do counter = counter + 1 fileName = string.format("%s_%d%s", tblName, counter, extension) end local filename = fileName writefile("./ReadTable/" .. filename, table.concat(content, "\n")) if forcedPrint then printAll() end warn("Output (" .. #buffer .. " lines), written to: [WorkspaceFolder]/Quake/ReadTable/" .. filename) return else warn("Your Exploit doesnt support file saves. Printing table in 10 seconds..") task.wait(10) end end printAll() end -- example: local tbl = { [1] = true, [3] = "Hello World!", [6] = 6.7, ["JustTable"] = { [3] = "f", ["JustTable2"] = { ["ImTired"] = true, ["Roblox"] = false, }, [1] = "eg", [2] = 999.43, }, [7] = 8, [4] = "A", [2] = false, [5] = 120000003024304, } readTable(tbl, true, true, "Example")