This commit is contained in:
Kai Vogelgesang 2020-07-08 12:55:01 +02:00
parent 56ab1255e2
commit fc0b34731f

View File

@ -140,7 +140,7 @@ local state_machine = {
["ASCEND_TREE"] = function() ["ASCEND_TREE"] = function()
local success, data = turtle.inspectUp() local success, data = turtle.inspectUp()
print("inspect", success, data) print("inspect", success, data)
if not s and T.state.y < TREE_MAX_Y - 1 then if not success and T.state.y < TREE_MAX_Y - 1 then
-- probably reset after chopping a block -- probably reset after chopping a block
T.up() T.up()
end end
@ -148,7 +148,7 @@ local state_machine = {
while true do while true do
local success, data = turtle.inspectUp() local success, data = turtle.inspectUp()
print("inspect", success, data) print("inspect", success, data)
if not s or data.name ~= LOG_NAME then if not success or data.name ~= LOG_NAME then
print("chopped all the wood") print("chopped all the wood")
-- chopped all the wood -- chopped all the wood
break break
@ -177,7 +177,7 @@ local state_machine = {
turtle.transferTo(SAP_SLOT) turtle.transferTo(SAP_SLOT)
turtle.select(SAP_SLOT) turtle.select(SAP_SLOT)
end end
turtle.placeDown()
if T.state.current_tree < MAX_TREE then if T.state.current_tree < MAX_TREE then
-- go to the next tree in this row -- go to the next tree in this row