Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
- turtle.refuel()
- end
- print("Enter the width, height, and depth in that order.")
- local width = tonumber(read())
- local height = tonumber(read())
- local depth = tonumber(read())
- function mineforward ()
- for i=2, width, 1 do
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- end
- end
- function invcheck ()
- if turtle.getItemCount(16) > 1 then
- return true
- else
- return false
- end
- end
- function finishmine()
- if height % 2 == 0 then
- turtle.turnRight()
- for i=1, height, 1 do
- turtle.down()
- end
- else
- turtle.turnLeft()
- turtle.turnLeft()
- mineforward()
- turtle.turnRight()
- end
- end
- local count = 0
- if turtle.detect() then
- for i=1, depth, 1 do
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- os.sleep(0.5)
- turtle.forward()
- turtle.turnRight()
- for i=1, height, 1 do
- mineforward()
- if i == height then
- finishmine()
- else
- turtle.digUp()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- count = count + 1
- if invcheck() then
- for i=1, count, 1 do
- turtle.back()
- end
- turtle.up()
- turtle.back()
- for i=1, 16, 1 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.forward()
- turtle.down()
- for i=1, count, 1 do
- turtle.forward()
- end
- end
- end
- else
- print("Place me in front of a block!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement