Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.select(1)
- turtle.refuel(64)
- print("radius: ")
- radius = tonumber(io.read())
- print("depth: ")
- depth = tonumber(io.read())
- progress = 0
- d = depth
- h = radius*2
- w = radius
- maxprogress = depth * h * h - depth * w * 2
- print("Fuel cost: " .. tostring(maxprogress + depth*depth*2) .. "/" .. tostring(turtle.getFuelLevel()))
- print("Press Y to continue")
- if io.read() ~= "Y" then
- return
- end
- di = 0
- hi = 0
- wi = 0
- writeposx, writeposy = term.getCursorPos()
- function update()
- term.setCursorPos(writeposx, writeposy)
- term.write(tostring(math.floor(progress/maxprogress*100)) .. "%")
- end
- while(di < d)
- do
- if turtle.getItemCount(10) > 0 then
- i = 0
- while(i < di)
- do
- turtle.up()
- i = i + 1
- end
- slot = 2
- while(slot < 16)
- do
- turtle.select(slot)
- turtle.dropUp(64)
- slot = slot + 1
- end
- turtle.select(1)
- i = 0
- while(i < di)
- do
- turtle.down()
- i = i + 1
- end
- end
- wi = 0
- while(wi < w)
- do
- hi = 1
- while(hi < h)
- do
- turtle.digDown()
- turtle.forward()
- turtle.digDown()
- progress = progress + 1
- update()
- hi = hi + 1
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- hi = 1
- while(hi < h)
- do
- turtle.digDown()
- turtle.forward()
- turtle.digDown()
- progress = progress + 1
- update()
- hi = hi + 1
- end
- wi = wi + 1
- if wi ~= w then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- turtle.turnLeft()
- i = 1
- while(i < h)
- do
- turtle.forward()
- i = i + 1
- end
- turtle.turnLeft()
- di = di + 1
- if di ~= d then
- turtle.down()
- end
- end
- i = 1
- while(i < depth)
- do
- turtle.up(depth)
- i = i + 1
- end
- slot = 2
- while(slot < 16)
- do
- turtle.select(slot)
- turtle.dropUp(64)
- slot = slot + 1
- end
- turtle.select(1)
- print(" ")
- print("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement