Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reader = peripheral.find("blockReader")
- local integrator = peripheral.find("redstoneIntegrator")
- while true do
- local data = reader.getBlockStates()
- print("First loop")
- if data["backwards"] == true then
- print("Backwards")
- if integrator.getAnalogInput("west") > 0 then
- integrator.setOutput("south", true)
- while true do
- local data1 = reader.getBlockStates()
- if data1["backwards"] == false then
- integrator.setOutput("south",false)
- break
- end
- end
- end
- elseif data["backwards"] == false then
- print("Not backwards")
- if integrator.getAnalogInput("east") > 0 then
- integrator.setOutput("south", true)
- while true do
- local data2 = reader.getBlockStates()
- if data2["backwards"] == true then
- integrator.setOutput("south",false)
- break
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement