Mining Turtle

The Mining Turtle is a block added by ComputerCraft, extending the functionality of the Turtle. It allows the turtle to not only place and interact with blocks, but also break them.
==Recipe==
==Usage==
The mining turtle is most commonly used as an early-game form of automatic mining. It is relatively cheap to maintain, however you must first find a diamond pickaxe. Once the user has obtained a diamond pickaxe, the mining turtle must be supplied with some form of fuel such as coal, to keep running. It is able to also find coal for itself while mining, lowering the maintenance required. 
The mining turtle has an internal inventory. When this is full it will return to the surface, that is the point at which it was initially placed. If a chest is placed on the block adjacent to the excavated area the mining turtle will deposit contents there while capacity is available. Otherwise it will drop the items on the ground. It will then return to the quarrying status if there is remaining fuel. The mining turtle can be safely picked up by breaking with a pickaxe, however all inventory will be dropped. 
Simple instruction:
To set the mining turtle to quarry everything in a square area right-click, type 'excavate' followed by a radius number (such as given example below). The area excavated is quite large so it may be advisable to use a low number when first using the mining turtle to see how the instruction is executed. When the mining turtle is then fed coal it will start to mine.
 excavate 5
Advanced instruction:
The mining turtle can also receive more advanced specific instruction. The following is a sample mining program:
local args = {...}
local stripLength = 32
if not #args == 1 then
 print("Usage: smine <mines>")
 return
end
function strip()
 for i=1,stripLength do
 checkFuel()
 checkInv()
 while not turtle.forward() do turtle.dig() end
 while turtle.detectUp() do
 turtle.digUp()
 sleep(0.2)
 end
 while turtle.detectDown() do
 turtle.digDown()
 sleep(0.2)
 end
 
 if i%8 == 0 then
 turtle.select(16)
 while not turtle.forward() do turtle.dig() end
 while turtle.detectUp() do
 turtle.digUp()
 sleep(0.2)
 end
 if not turtle.back() then
 turtle.turnLeft()
 turtle.turnLeft()
 while not turtle.forward do turtle.dig() end
 turtle.turnLeft()
 turtle.turnLeft()
 end
 turtle.placeUp()
 turtle.select(1)
 end
 end
 
 turtle.turnLeft()
 turtle.turnLeft()
 
 for i=1,stripLength do
 while not turtle.forward() do turtle.dig() end
 end
end
function checkFuel()
 if turtle.getFuelLevel() <= 64 then
 print("Error: Low fuel")
 for i=1,14 do
 turtle.select(i)
 turtle.refuel()
 end
 end
end
function checkInv()
 isFull = true
 
 for i=1,14 do
 if turtle.getItemCount(i) == 0 then
 isFull = false
 end
 end
 
 if isFull == true then
 turtle.select(15)
 while not turtle.placeDown() do turtle.digDown() end
 for i=1,14 do
 turtle.select(i)
 turtle.dropDown()
 end
 end
end
print("Place torches in slot 16")
print("Place chest/s in slot 15 (will be automatically placed and filled when inventory is full)")
for x=1,args[1] do
 turtle.turnLeft()
 strip()
 strip()
 turtle.turnRight()
 for y=1,3 do turtle.forward() end
end
This program can be downloaded in-game by running the command: pastebin get Df8Q6xp7 smine
Category:ComputerCraftCategory:BuildingCategory:Automated miningCategory:Machines that use solid fuels