Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuel()
- if turtle.getFuelLevel() <= 50 then
- for i = 1, 16 do
- turtle.select(i)
- turtle.refuel()
- end
- turtle.select(1)
- end
- end
- function forward()
- refuel()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- end
- function getnvar(question, limit)
- write(question)
- n = read()
- if tonumber(n) then
- n = tonumber(n)
- if n > limit then
- print("Too big!")
- return getnvar(question, limit)
- else
- return n
- end
- else
- print("That's not a number")
- return getnvar(question, limit)
- end
- end
- shell.run("clear")
- print("Please put a chest behind me.")
- width = getnvar("\nHow wide should I dig? ", 32)
- depth = getnvar("\n(To dig to the bottom of the world insert my Y coordinate - 6)\nHow deep should I dig? ", 255)
- height = 3
- for y = 1, depth do
- turtle.digDown()
- turtle.down()
- for x = 1, width do
- for z = 2, width do
- forward()
- end
- for nz = 2, width do
- turtle.back()
- end
- if x ~= width then
- turtle.turnRight()
- forward()
- turtle.turnLeft()
- end
- end
- turtle.turnLeft()
- for nx = 2, width do
- forward()
- end
- turtle.turnLeft()
- for ny = 1, y do
- turtle.up()
- end
- for slot = 1, 16 do
- turtle.select(slot)
- turtle.drop()
- end
- turtle.select(1)
- turtle.turnLeft()
- turtle.turnLeft()
- if y ~= depth then
- for _y = 1, y do
- turtle.down()
- end
- end
- end
- print("\n\nDone!")
Add Comment
Please, Sign In to add comment