Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local side = "left"
- local mon = peripheral.find("monitor")
- while true do
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(colors.black)
- mon.setTextScale(2)
- mon.setBackgroundColor(colors.lime)
- mon.setCursorPos(1,2)
- mon.write("Open")
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(1,1)
- mon.write("Close")
- local event, monid, x, y = os.pullEvent("monitor_touch")
- redstone.setOutput("top", false)
- print (y)
- if event == "monitor_touch" and y == 1 then
- redstone.setOutput("top", false)
- rednet.broadcast("Closing")
- end
- if y == 2 then
- redstone.setOutput("top", true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment