Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local logFile = "me_items_log.txt"
- local device = peripheral.find("meBridge")
- if not device then
- print("No ME Bridge found!")
- return
- end
- local file = fs.open(logFile, "w")
- file.writeLine("ME Bridge - listItems() Output:\n")
- local success, items = pcall(device.listItems)
- if success and type(items) == "table" then
- for slot, data in pairs(items) do
- file.writeLine("Slot: " .. tostring(slot))
- for key, value in pairs(data) do
- if type(value) == "table" then
- file.writeLine(" " .. key .. " = [TABLE]")
- else
- file.writeLine(" " .. key .. " = " .. tostring(value))
- end
- end
- end
- else
- file.writeLine("Error: Unable to retrieve listItems()")
- end
- file.close()
- print("\nItem log saved to " .. logFile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement