Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --First computer on the line ID 183 with a wired modem on the top
- rednet.open("top")
- while true do
- local left=rs.getInput("left")
- local right=rs.getInput("right")
- local senderID,message,protocol=rednet.receive(1)
- if left then
- os.startTimer(3)
- exit = false
- while not exit do
- event = os.pullEvent()
- if event =="timer" then
- exit = true
- elseif event=="redstone" then
- local right = rs.getInput("right")
- if right then rs.setOutput("front",true)
- rs.setOutput("back",true)
- rednet.send(202,"blocked")
- exit = true
- end
- end
- end
- elseif right then
- os.startTimer(3)
- exit = false
- while not exit do
- event = os.pullEvent()
- if event =="timer" then
- exit = true
- elseif event=="redstone" then
- local left= rs.getInput("left")
- if left then
- rs.setOutput("front",true)
- rs.setOutput("back",true)
- rednet.send(202,"clear")
- exit = true
- end
- end
- end
- end
- if message=="clear" then
- rs.setOutput("front",false)
- rs.setOutput("back",false)
- elseif message=="blocked" then
- rs.setOutput("front",true)
- rs.setOutput("back",true)
- end
Advertisement
Add Comment
Please, Sign In to add comment