Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("left")
- modem.open(1)
- values = {}
- count = 0
- while true do
- e, m, s, r, message = os.pullEvent("modem_message")
- count = count + 1
- i = 1
- for word in string.gmatch(message, "[^,]+") do
- if i < 2 then
- i = i + 1
- index = word
- else
- i = 1
- value = tonumber(word)
- end
- end
- values[index] = value
- for j, k in pairs(values) do
- total = 0
- total = total + k
- end
- if total < #values*9000 then
- redstone.setOutput("top", true)
- else
- redstone.setOutput("top", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement