turtle.select(1)
write ("Enter the area size: ")
local mainloo = read()
local mainloop = tonumber(mainloo)
print ("Selected area is: ",mainloo,"x",mainloo)
write ("How deep do you want to dig? ")
local deep = read()
local depth = tonumber(deep)
local num1 = 0
local volume = ((mainloop*mainloop*depth)-depth)
print("The total volume is :",volume," blocks")
while (num1 < depth) do
turtle.select(1)
local loop4 = 2
local limiter = 3
while (loop4 < mainloop)
do
local bigloop = 0
while (bigloop < 4)
do
local length = limiter
local loop = 1
turtle.turnLeft()
while (loop < length)
do
while (turtle.detect())
do
turtle.dig()
end
turtle.forward()
loop = loop + 1
end
bigloop = bigloop + 1
end
local slots = 17
local loop2 = 1
while (loop2 <slots)
do
turtle.select(loop2)
turtle.drop()
loop2 = loop2+1
end
if(turtle.getFuelLevel() < 50000)
then
turtle.turnRight()
turtle.select(1)
turtle.suck()
turtle.refuel()
turtle.turnLeft()
end
local level = turtle.getFuelLevel()
local limit = turtle.getFuelLimit()
print ("Fuel: ",level,"/",limit)
limiter = limiter+1
loop4 = loop4+1
end
turtle.select(1)
turtle.dig()
turtle.turnRight()
turtle.select(2)
turtle.dig()
turtle.turnLeft()
turtle.digDown()
turtle.down()
turtle.dig()
turtle.select(1)
turtle.place()
turtle.turnRight()
turtle.dig()
turtle.select(2)
turtle.dig()
turtle.place()
turtle.turnLeft()
local looper = 1
while (looper < 17)
do
turtle.select(looper)
turtle.drop()
looper = looper+1
end
num1 = num1 +1
end
print ("Finished")
local looping = 0
while (looping < depth)
do
turtle.up()
looping = looping +1
end
turtle.select(1)
turtle.suckUp()
turtle.place()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.select(2)
turtle.suckUp()
turtle.turnRight()
looping = 0
while (looping < depth)
do
turtle.dig()
turtle.place()
turtle.down()
looping = looping+1
end
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnLeft()