Posted 04 February 2012 - 09:36 PM
I've just found out an new feature in TurtleOS 1.3:
The program is called "well".
-- Dig down untill we can dig down no further
local depth = 0
local collected = 0
print( "Descending..." )
local function addDepth()
depth = depth + 1
if math.fmod( depth, 10 ) == 0 then
print( "Descended "..depth.." meters.")
end
end
local reseal = false
if turtle.digDown() then
reseal = true
end
while true do
if turtle.down() then
addDepth()
else
if turtle.digDown() then
collected = collected + 1
end
if turtle.down() then
addDepth()
else
break
end
end
end
print( "Returning to surface..." )
The program is called "well".