Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("How long should I go forward for?")
- length=tonumber(read())
- current=0
- oneBehind=-1
- faceDepth=10
- chestDirection="right"
- print("How far am I from the chest?")
- chestDist=tonumber(read())
- chestCurrent=0
- function DigFace()
- turtle.turnLeft()
- for i=1,faceDepth do
- turtle.dig()
- turtle.digDown() turtle.down()
- end
- turtle.turnRight() turtle.turnRight()
- for i=1,faceDepth do
- turtle.dig() turtle.up()
- end
- turtle.turnLeft()
- end
- function EmptyInventory(dist)
- turtle.turnRight() turtle.turnRight()
- while current>0 do
- turtle.forward()
- current=current-1
- end
- if chestDirection=="right" then turtle.turnRight()
- else turtle.turnLeft() end
- while chestCurrent<chestDist do
- turtle.forward()
- chestCurrent=chestCurrent+1
- end
- turtle.down()
- for i=1,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.turnRight() turtle.turnRight()
- turtle.up()
- while currentChest>0 do
- turtle.forward()
- currentChest=currentChest-1
- end
- if chestDirection=="right" then turtle.turnLeft()
- else turtle.turnRight() end
- while current<dist do
- turtle.forward()
- current=current+1
- end
- end
- while current<length do
- if oneBehind<current then DigFace() end
- turtle.dig()
- oneBehind=oneBehind+1
- if turtle.forward() then
- current=current+1
- oneBehind=current-1
- end
- if turtle.getItemCount(16)>0 then EmptyInventory(current) end
- end
- EmptyInventory(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement