-- This program will break blocks below it matching the block in slot # 1 and then return to the starting point
local moveFwd = 0
local function tryMoveFwd()
while turtle.detect() do
if turtle.dig() then
sleep(0.05)
end
end
turtle.forward(1)
moveFwd = moveFwd + 1
end
-- This is the main process loop of the program where blocks are checked and broken
turtle.select( 1 )
if turtle.getItemCount() < 1 then
print("please place desired harvest block in slot # 1")
return
end
while turtle.compareDown() do
turtle.digDown()
tryMoveFwd()
end
-- the next section returns the turtle to its starting point
for i = 1, moveFwd do
turtle.back()
end
Comments