Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slotnum = chest.getSizeInventory() --Use the Max Invantory Size to calculate the Slot number and Loop amount
- local data = fs.open("data.db", "a")
- for i=1,slotnum do -- LOOP!
- local tableInfo = chest.getStackInSlot(i)
- if tableInfo ~= nil then
- for key, value in pairs(tableInfo) do
- data.writeLine(key .. " = " .. tostring(value)) -- Dump table data in to the Data.db
- print(key .. " = " .. tostring(value))
- data.writeLine("") --Add a line brake to make it pretty.
- end
- end
- end
- data.close() -- Save the file.
Advertisement
Add Comment
Please, Sign In to add comment