Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- 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 >= 9 then
- redstone.setOutput("right", false)
- else
- redstone.setOutput("right", true)
- end
- end
- elseif event == "rednet_message" then
- if id == 5 then
- if text == "door-on" or text == "door-off" then
- msg = text
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement