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)
return "CHECK_TREE"
end
end,
["CHECK_TREE"] = function()
if not turtle.detect() then
@@ -130,7 +130,7 @@ local state_machine = {
turtle.digDown()
return "ASCEND_TREE"
end
end
end,
["ASCEND_TREE"] = function()
local success, data = turtle.inspectUp()
@@ -153,7 +153,7 @@ local state_machine = {
T.up()
end
return "FINALIZE_TREE"
end
end,
["FINALIZE_TREE"] = function()
-- make sure we are directly above the sapling target
@@ -182,7 +182,7 @@ local state_machine = {
else
-- went through the entire farm once
return "OUTPUT"
end
end,
["OUTPUT"] = function()
greedy_move(OUTPUT_TARGET.x, OUTPUT_TARGET.z, OUTPUT_TARGET.o)
@@ -197,7 +197,7 @@ local state_machine = {
end
return "RESUPPLY_SAPS"
end
end,
["RESUPPLY_SAPS"] = function()
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)
return "RESUPPLY_FUEL"
end
end,
["RESUPPLY_FUEL"] = function()
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_tree = 0
return "MOVE_TO_TREE"
end
end,
}