Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getFrontBlock()
- local blockExists, blockData = turtle.inspect()
- return blockData.name
- end
- function removeObstacle()
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- function reverseSteps( x, y )
- for i = 1, x, 1 do
- turtle.back()
- end
- for i = 1, y, 1 do
- turtle.down()
- end
- end
- function displayError()
- print("Make sure to place the turtle where it is touching and facing the center of the obsidian pillar's side.")
- end
- local countY = 0
- local block = getFrontBlock()
- while block == "minecraft:obsidian" do
- removeObstacle()
- turtle.up()
- countY = countY + 1
- block = getFrontBlock()
- end
- if block == "minecraft:iron_bars" then
- turtle.dig()
- end
- countX = 0
- block = getFrontBlock()
- while block == nil and countX < 10 do
- turtle.forward()
- countX = countX + 1
- block = getFrontBlock()
- end
- if countX < 10 and block == "minecraft:bedrock" then
- turtle.attackUp()
- else
- displayError()
- end
- reverseSteps( countX, countY )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement