Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dest = 16
- me = 15
- sleep = 1
- modem = peripheral.find("modem")
- inv = peripheral.wrap("left")
- items = {}
- if not modem.isOpen(me) then
- modem.open(me)
- end
- function check_inv()
- items = {}
- totalCount = 0
- for k, v in pairs(inv.list()) do
- details = inv.getItemMeta(k)
- items[k] = { slot = k, count = v.count, name = details.displayName }
- print(k .. ": " .. v.count .. "x " .. details.displayName)
- totalCount = totalCount + v.count
- end
- print("Container has " .. totalCount .. " items")
- modem.transmit(dest, me, items)
- end
- while true do
- check_inv()
- os.sleep(sleep)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement