Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function digForward(x)
- for i = 1,x,1 do
- if spaceInInventory() == 0 then
- placeChest()
- end
- while(turtle.detect()) do
- turtle.dig()
- os.sleep(0.45)
- end
- turtle.forward()
- while(turtle.detectUp()) do
- turtle.digUp()
- os.sleep(0.45)
- end
- end
- end
- function spaceInInventory()
- for i = 1,16,1 do
- if turtle.getItemCount(i) == 0 then
- return 1
- end
- end
- return 0
- end
- function goBack(x, numberSpirals)
- turtle.turnRight()
- for i=0,x/2,1 do
- turtle.back()
- end
- turtle.turnLeft()
- digForward(3*(numberSpirals/4))
- end
- function placeChest()
- refuel()
- turtle.select(2)
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.back()
- turtle.select(1)
- turtle.place(1)
- for i = 2 , 16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- turtle.dig()
- turtle.turnLeft()
- end
- function refuel()
- if turtle.getFuelLevel() > 5000 then
- return
- end
- for i=2,16,1 do
- turtle.select(i)
- turtle.refuel(64)
- end
- end
- local arguments = {...}
- x = 0
- for i = 1,tonumber(arguments[1]),1 do
- if i % 2 == 0 then
- x = x+2
- else x = x+1 end
- digForward(x)
- turtle.turnLeft()
- end
- goBack(x, tonumber(arguments[1]))
- placeChest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement