Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("bottom")
- local chest = peripheral.wrap("right")
- local qtd = 0
- while true do
- local sender, message, protocol = rednet.receive("bau1")
- if message == "count" then
- lista = chest.list()
- range = #lista
- qtd_1 = 0
- for i = 1, range, 1 do
- qtd_1 = qtd_1 + (lista[i].count)
- end
- print(qtd_1)
- rednet.broadcast(qtd_1, "qtd_1")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement