-- ######################################
-- Fortune Block Breaker
-- version 0.1
-- http://hevohevo.hatenablog.com/
-- This Program requires a Fortune Mining Turtle by "More Turtles" mod
-- http://www.computercraft.info/forums2/index.php?/topic/16465-mc164152-more-turtles-v112/
-- Side view
-- T: fortune mining turtle, B: chest for blocks, I: chest for items
-- B
-- T
-- I
-- Config
FUEL_SLOT = 16
BLOCK_SLOT = 1
local p = peripheral.wrap("right")
assert((p and p.digFortune), "required Fortune Mining Turtle")
-- Functions
function myRefuel()
turtle.select(FUEL_SLOT)
turtle.refuel()
print("Fuel: ",turtle.getFuelLevel())
end
function suckBlock() -- return true/false
turtle.select(BLOCK_SLOT)
return turtle.suckUp()
end
function placeDig(count)
turtle.select(BLOCK_SLOT)
for i=1,count do
assert(turtle.place())
assert(p.digFortune())
end
end
function dropAll(start, goal)
for i=start, goal do
turtle.select(i)
turtle.dropDown()
end
end
-- Main
myRefuel()
while suckBlock() do
placeDig(turtle.getItemCount(BLOCK_SLOT))
dropAll(1,16)
end
print("Finished: fuel ",turtle.getFuelLevel())