Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This will turn the light on!
- function turnOnLight()
- if turtle.compare() then
- redstone.setOutput("front", true)
- sleep(10)
- redstone.setOutput("front", false)
- end
- end
- --This line makes sure that
- --it is comparing the first item
- turtle.select(1)
- while true do
- sleep(0)
- if not turtle.detect() then
- turtle.forward()
- turnOnLight()
- turtle.turnRight()
- if turtle.detect() then
- turtle.turnLeft()
- end
- else
- turtle.turnRight()
- if turtle.detect() then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement