Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- size = args[1]
- if(size % 2 == 1) then
- size = size - 1
- end
- function clear()
- turtle.digUp()
- turtle.digDown()
- end
- function move()
- if (turtle.getItemCount(16) ~= 0) then
- dropItems()
- end
- if(turtle.getFuelLevel() == 0) then
- error("Out of fuel")
- end
- while (not turtle.forward()) do
- turtle.dig()
- end
- end
- function right()
- turtle.turnRight()
- end
- function left()
- turtle.turnLeft()
- end
- function down3()
- for num = 1, 3 do
- turtle.digDown()
- turtle.down()
- end
- end
- function outer()
- for num = 1, 3 do
- for num = 2, size do
- clear()
- move()
- end
- right()
- end
- end
- function inner()
- peaks = (size / 2) - 1
- for num = 1, peaks do
- ascend()
- descend()
- end
- clear()
- move()
- right()
- end
- function ascend()
- clear()
- move()
- right()
- for num = 3, size do
- clear()
- move()
- end
- left()
- end
- function descend()
- clear()
- move()
- left()
- for num = 3, size do
- clear()
- move()
- end
- right()
- end
- function dropItems()
- right()
- right()
- turtle.select(1)
- while (not turtle.place()) do
- turtle.dig()
- end
- for num = 2, 16 do
- turtle.select(num)
- turtle.drop()
- end
- turtle.select(2)
- left()
- left()
- if(turtle.getItemCount(1) == 0) then
- error("Out of chests")
- end
- end
- while(true) do
- outer()
- inner()
- down3()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement