Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Place down and detect block below
- TR = true
- TL = false
- check_one = false
- check_two = false
- -- Detect block below
- success, data = turtle.inspectDown()
- while success do
- -- If block is obsidian break and move forward
- if data.name == "minecraft:obsidian" then
- turtle.digDown()
- turtle.forward()
- check_one = false
- check_two = false
- else
- turtle.back()
- check_one = true
- -- If not obsidian, turn right and search for obsidian
- if TR then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- TR = false
- TL = true
- -- If not obsidian, turn left and search for obsidian
- elseif TL then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- TR = true
- TL = false
- end
- success, data = turtle.inspectDown()
- if success and data.name ~= "minecraft:obsidian" then
- check_two = true
- end
- if check_one and check_two then
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- if TR then
- TR = false
- TL = true
- elseif TL then
- TR = true
- TL = false
- end
- end
- end
- success, data = turtle.inspectDown()
- if success ~= true then
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment