Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- channel = 16
- if peripheral.getType("left")=="modem" then
- modem = peripheral.wrap("left")
- if modem.isWireless() then
- modem.open(channel)
- while modem.isOpen(channel) do
- colorTable = {}
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- print(" ")
- colorTable = message
- if #colorTable == 16 then
- nCT = 0
- for i=1,#colorTable do
- nCT = nCT+colorTable[i]
- end
- end
- if nCT ~= nil then
- redstone.setBundledOutput("back", nCT)
- if peripheral.getType("front")=="monitor" then
- m = peripheral.wrap("front")
- m.setBackgroundColor(32768)
- m.clear()
- h=1
- v=1
- m.setCursorPos(h,v)
- for u=1,#colorTable do
- if (u+1)%2==0 then
- h=h+1
- end
- if h==8 then
- h=2
- v=v+1
- end
- if u==9 then
- v=v+1
- end
- m.setCursorPos(h,v)
- m.setTextColor(2^(u-1))
- if colorTable[u]==0 then
- m.setBackgroundColor(32768)
- else
- m.setBackgroundColor(2^(u-1))
- print(colorTable[u])
- end
- m.write("=")
- h=h+1
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment