This commit is contained in:
Kai Vogelgesang 2020-07-08 05:48:43 +02:00
parent a63a25e5eb
commit 8ac0a41981

View File

@ -116,7 +116,7 @@ local state_machine = {
greedy_move(x, z, o) greedy_move(x, z, o)
return "CHECK_TREE" return "CHECK_TREE"
end end,
["CHECK_TREE"] = function() ["CHECK_TREE"] = function()
if not turtle.detect() then if not turtle.detect() then
@ -130,7 +130,7 @@ local state_machine = {
turtle.digDown() turtle.digDown()
return "ASCEND_TREE" return "ASCEND_TREE"
end end
end end,
["ASCEND_TREE"] = function() ["ASCEND_TREE"] = function()
local success, data = turtle.inspectUp() local success, data = turtle.inspectUp()
@ -153,7 +153,7 @@ local state_machine = {
T.up() T.up()
end end
return "FINALIZE_TREE" return "FINALIZE_TREE"
end end,
["FINALIZE_TREE"] = function() ["FINALIZE_TREE"] = function()
-- make sure we are directly above the sapling target -- make sure we are directly above the sapling target
@ -182,7 +182,7 @@ local state_machine = {
else else
-- went through the entire farm once -- went through the entire farm once
return "OUTPUT" return "OUTPUT"
end end,
["OUTPUT"] = function() ["OUTPUT"] = function()
greedy_move(OUTPUT_TARGET.x, OUTPUT_TARGET.z, OUTPUT_TARGET.o) greedy_move(OUTPUT_TARGET.x, OUTPUT_TARGET.z, OUTPUT_TARGET.o)
@ -197,7 +197,7 @@ local state_machine = {
end end
return "RESUPPLY_SAPS" return "RESUPPLY_SAPS"
end end,
["RESUPPLY_SAPS"] = function() ["RESUPPLY_SAPS"] = function()
greedy_move(SAPS_TARGET.x, SAPS_TARGET.z, SAPS_TARGET.o) greedy_move(SAPS_TARGET.x, SAPS_TARGET.z, SAPS_TARGET.o)
@ -209,7 +209,7 @@ local state_machine = {
ensure_item_count(BACKUP_SAP_SLOT_TARGET_COUNT) ensure_item_count(BACKUP_SAP_SLOT_TARGET_COUNT)
return "RESUPPLY_FUEL" return "RESUPPLY_FUEL"
end end,
["RESUPPLY_FUEL"] = function() ["RESUPPLY_FUEL"] = function()
greedy_move(FUEL_TARGET.x, FUEL_TARGET.z, FUEL_TARGET.o) greedy_move(FUEL_TARGET.x, FUEL_TARGET.z, FUEL_TARGET.o)
@ -222,7 +222,7 @@ local state_machine = {
T.state.current_row = 0 T.state.current_row = 0
T.state.current_tree = 0 T.state.current_tree = 0
return "MOVE_TO_TREE" return "MOVE_TO_TREE"
end end,
} }