Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reverseDoor()
- if state == true then
- state = false
- redstone.setOutput("back", false)
- mon.clear()
- mon.setBackgroundColor(colors.red)
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(9,5)
- mon.write("Porte Ouverte")
- else
- state =true
- redstone.setOutput("back", true)
- mon.clear()
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- mon.setTextColor(colors.blue)
- mon.setCursorPos(9,5)
- mon.write("Porte Fermee")
- end
- end
- mon = peripheral.wrap("back")
- w = peripheral.wrap("right")
- state = nil
- w.open(0)
- mon.setTextScale(1)
- redstone.setOutput("back", true)
- state = false --false : close, true : open
- while true do
- while event ~= "modem_message" or event ~= "monitor_touch" do
- event, side, xpos, ypos = os.pullEvent()
- end
- if event == "monitor_touch" then
- reverseDoor()
- elseif event == "modem_message" then
- if message = 1 then
- w.transmit(0, 0, state)
- end
- reverseDoor()
- redstone.setOutput("back",true)
- mon.clear()
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(9,5)
- mon.write("Porte fermee")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement