Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- rednet.open("bottom")
- mon.setTextScale(0.5)
- function getData()
- local ids = {73,70,69,71,72,75}
- local states = {}
- for r = 1,6 do
- print("Waiting for response from Cp"..r)
- while true do
- local senderID, mess, dist = rednet.receive()
- if senderID == ids[r] then
- states[r] = mess
- break
- end
- end
- end
- return states
- end
- function show()
- data = getData()
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,1)
- mon.write("Breeding apiary:")
- for k = 3, 8 do
- mon.setCursorPos(6,k)
- mon.write("Apiary n°"..(k-2)..":")
- end
- mon.setCursorPos(20,1)
- mon.write("State:")
- for v = 3, 8 do
- if data[(v-2)] == "In progress.." then
- mon.setTextColor(colors.green)
- else
- mon.setTextColor(colors.red)
- end
- mon.setCursorPos(20,v)
- mon.write(data[(v-2)])
- mon.setTextColor(colors.white)
- end
- end
- while true do
- show()
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement