Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- success = false
- triedTimes = 1
- turn = 1
- slot = 1
- turtle.select (slot)
- while triedTimes < 5 do
- t, b=turtle.inspectBlock ()
- if t and b.name=="minecraft:stone" then
- turtle.digDown ()
- turtle.placeDown ()
- else
- if turn == 1 then
- doTurnRight ()
- else
- doTurnLeft ()
- end
- repeat
- moveForward ()
- t, b=turtle.inspectDown()
- success = t and (b.name=="minecraft:stone")
- if not success then
- triedTimes = triedTimes + 1
- end
- until success or triedTimes == 5
- if turtle.getItemCount (slot) == 1 then
- turtle.select (slot = slot + 1)
- end
- end
- function turnRight ()
- turtle.turnRight ()
- moveForward ()
- turtle.turnRight ()
- turn = 2
- end
- function turnLeft ()
- turtle.turnLeft ()
- moveForward ()
- turtle.turnLeft()
- turn = 1
- end
- function moveForward ()
- turtle.forward ()
- turtle.forward ()
- turtle.forward ()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement