This commit is contained in:
Kai Vogelgesang 2020-07-08 12:52:41 +02:00
parent 15e280a1f3
commit 56ab1255e2

View File

@ -139,6 +139,7 @@ local state_machine = {
["ASCEND_TREE"] = function()
local success, data = turtle.inspectUp()
print("inspect", success, data)
if not s and T.state.y < TREE_MAX_Y - 1 then
-- probably reset after chopping a block
T.up()
@ -146,12 +147,15 @@ local state_machine = {
while true do
local success, data = turtle.inspectUp()
print("inspect", success, data)
if not s or data.name ~= LOG_NAME then
print("chopped all the wood")
-- chopped all the wood
break
end
turtle.digUp()
if T.state.y == TREE_MAX_Y - 1 then
print("below last log")
-- we are below the last log, no need to move up
break
end