Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local val = 0
- local msg = "door-on"
- while true do
- event, id, text = os.pullEvent()
- if event == "redstone" then
- if msg == "door-on" then
- val = redstone.getAnalogInput("back")
- if val >= 10 then
- redstone.setOutput("left", false)
- else
- redstone.setOutput("left", true)
- end
- end
- elseif event == "rednet_message" then
- if id == 24 then
- if text == "door-on" and msg == "door-off" then
- msg = text
- redstone.setOutput("left", true)
- elseif text == "door-off" and msg == "door-on" then
- msg = text
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement