Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --use the plethora mod
- local modem = peripheral.wrap("top")
- local chest = peripheral.wrap("back")
- modem.open(1) --do nothing, never used
- function state_of_chest()
- local list_of_item = chest.list() --return the slot number and a table where the keys are "count","name","damage"
- total = 0
- for slot,info in pairs(list_of_item) do
- if info.name == "minecraft:stone" then
- total = total + info.count
- end
- end
- modem.transmit(5,1,total) -- channel for sending, channel for the answer, message
- end
- while true do
- state_of_chest()
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement