Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ilosc = 3
- rednet.open("right")
- glass = peripheral.wrap("left")
- mon = peripheral.wrap("top")
- local table = {}
- for i = 1,ilosc do
- table[i-1] = "no connection"
- end
- while true do
- id, message = rednet.receive()
- altar = string.sub(message,0,6)
- message = string.sub(message, 7)
- numer = string.sub(altar,6)
- table[numer-1] = message
- mon.clear()
- for i = 1,ilosc do
- mon.setCursorPos(1,i)
- mon.setTextScale(1.4)
- mon.write("Altar"..i..": ")
- if(table[i-1] == "no connection") then
- mon.setTextColor(colors.yellow)
- else
- mon.setTextColor(colors.green)
- end
- mon.write(table[i-1])
- mon.setTextColor(colors.red)
- glass.addText(1,(i-1)*10+1,"Altar"..i..": "..table[i-1],0xFF0000)
- end
- glass.sync()
- glass.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement