Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_1")
- rednet.open("top")
- while true do
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(colors.black)
- mon.setCursorPos(1,3)
- mon.write("=======")
- mon.setTextScale(1)
- mon.setBackgroundColor(colors.pink)
- mon.setCursorPOS(1,1)
- mon.write(" ")
- mon.setCursorPos(1,2)
- mon.write(" Ouvert")
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(1,4)
- mon.write(" Fermé ")
- mon.setCursorPOS(1,5)
- mon.write(" ")
- event, monid, x, y = os.pullEvent("monitor_touch")
- redstone.setOutput("right", false)
- redstone.setOutput("left", false)
- print (y)
- if event == "monitor_touch" and y => 3 then
- redstone.setOutput("right", false)
- redstone.setOutput("left", false)
- rednet.broadcast("locking")
- end
- if y =< 3 then
- redstone.setOutput("right", true)
- redstone.setOutput("left", true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement