Orcinuss

ObjectCC

Jun 14th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local slotnum = chest.getSizeInventory() --Use the Max Invantory Size to calculate the Slot number and Loop amount
  2. local data = fs.open("data.db", "a")
  3. for i=1,slotnum do -- LOOP!
  4.     local tableInfo = chest.getStackInSlot(i)
  5.     if tableInfo ~= nil then
  6.         for key, value in pairs(tableInfo) do
  7.             data.writeLine(key .. " = " .. tostring(value)) -- Dump table data in to the Data.db
  8.             print(key .. " = " .. tostring(value))
  9.             data.writeLine("") --Add a line brake to make it pretty.
  10.         end
  11.     end
  12. end
  13. data.close() -- Save the file.
Advertisement
Add Comment
Please, Sign In to add comment