Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lastempty = function()
- turtle.digUp()
- turtle.select(2)
- turtle.placeUp()
- for i = 3, 16, 1
- do
- turtle.select(i)
- turtle.dropUp(64)
- end
- turtle.select(2)
- turtle.digUp()
- turtle.select(1)
- end
- empty = function()
- if turtle.getItemCount(15) >= 1 then
- turtle.digUp()
- turtle.select(2)
- turtle.placeUp()
- for i = 3, 16, 1
- do
- turtle.select(i)
- turtle.dropUp(64)
- end
- turtle.select(2)
- turtle.digUp()
- turtle.select(1)
- end
- end
- destroy = function()
- empty()
- turtle.digDown()
- turtle.digUp()
- while turtle.detect() == true do
- turtle.dig()
- end
- end
- lastdestroy = function()
- empty()
- turtle.digUp()
- turtle.digDown()
- end
- row = function(distance)
- for i = 0, distance, 1
- do
- destroy()
- turtle.forward()
- end
- end
- righthook = function()
- empty()
- turtle.turnRight()
- destroy()
- turtle.forward()
- turtle.turnRight()
- end
- lefthook = function()
- empty()
- turtle.turnLeft()
- destroy()
- turtle.forward()
- turtle.turnLeft()
- end
- square = function(Length, Depth)
- empty()
- if Length % 2 == 0 then
- for i = 1, Length, 2
- do
- row(Depth)
- righthook()
- row(Depth)
- lefthook()
- end
- row(Depth)
- righthook()
- row(Depth)
- lastdestroy()
- turtle.turnRight()
- for i = 0, Length, 1
- do
- turtle.forward()
- end
- turtle.turnRight()
- elseif Length % 2 ~= 0 then
- for i = 0, Length, 2
- do
- row(Depth)
- righthook()
- row(Depth)
- lefthook()
- end
- row(Depth)
- lastdestroy()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 0, Depth, 1
- do
- turtle.forward()
- end
- turtle.turnRight()
- for i = 0, Length, 1
- do
- turtle.forward()
- end
- turtle.turnRight()
- elseif Length == 0 then
- row(Depth)
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 0, Depth, 1
- do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- elseif Depth == 0 then
- turtle.turnRight()
- row(Length)
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 0, Length, 1
- do
- turtle.forward()
- end
- turtle.turnRight()
- end
- lastempty()
- end
- term.write("Select Depth: ")
- local depth = read()
- depth = depth - 2
- term.write("Select Length: ")
- local length = read()
- length = length - 2
- square(length, depth)
- print("Mining Completed")
Add Comment
Please, Sign In to add comment