Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- local mn = peripheral.wrap("bottom")
- local mnb = peripheral.wrap("monitor_11")
- local function clear()
- mn.clear()
- mnb.clear()
- end
- local function setTextColor(clr)
- mn.setTextColor(clr)
- mnb.setTextColor(clr)
- end
- local function setCursorPos(x,y)
- mn.setCursorPos(x,y)
- mnb.setCursorPos(x,y)
- end
- local function setBackgroundColor(clr)
- mn.setBackgroundColor(clr)
- mnb.setBackgroundColor(clr)
- end
- local function write(txt)
- mn.write(txt)
- mnb.write(txt)
- end
- local light = false
- while (true) do
- local senderId, message, protocol = rednet.receive()
- if (message == "light") then
- if (light == false) then
- light = true
- for i=1,sx do
- setCursorPos(i,2)
- setBackgroundColor(colors.yellow)
- write(" ")
- end
- else
- light = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement