From 563ae7dd3c42992e00285cd8fb98963e1deb5d6d Mon Sep 17 00:00:00 2001 From: Kai Vogelgesang Date: Wed, 8 Jul 2020 13:30:00 +0200 Subject: [PATCH 1/2] Debug --- kai/woodfarm.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kai/woodfarm.lua b/kai/woodfarm.lua index 7745dd7..ef547e1 100644 --- a/kai/woodfarm.lua +++ b/kai/woodfarm.lua @@ -111,22 +111,15 @@ local state_machine = { local x, z = calculate_tree_position(T.state.current_row, T.state.current_tree) local o - if T.state.current_tree < 3 or T.state.current_tree > 12 then - breakpoint() - end - if T.state.current_row ~= 1 and T.state.current_tree == 1 then - print("new row") -- we just turned towards a new row and are approaching in positive x direction x = x - 1 o = "+x" elseif T.state.current_row % 2 == 0 then - print("even row") -- we are in an even row and approaching in positive z direction z = z - 1 o = "+z" else - print("odd row") -- we are approaching in negative z direction z = z + 1 o = "-z" @@ -206,6 +199,9 @@ local state_machine = { end, ["OUTPUT"] = function() + + breakpoint() + greedy_move(OUTPUT_TARGET.x, OUTPUT_TARGET.z, OUTPUT_TARGET.o) -- Drop all logs @@ -221,6 +217,9 @@ local state_machine = { end, ["RESUPPLY_SAPS"] = function() + + breakpoint() + greedy_move(SAPS_TARGET.x, SAPS_TARGET.z, SAPS_TARGET.o) turtle.select(SAP_SLOT) @@ -233,6 +232,9 @@ local state_machine = { end, ["RESUPPLY_FUEL"] = function() + + breakpoint() + greedy_move(FUEL_TARGET.x, FUEL_TARGET.z, FUEL_TARGET.o) if turtle.getFuelLevel() < FUEL_LEVEL_TARGET then From 477007bc5991a6d1f75924cfa5553f2b0eaeea38 Mon Sep 17 00:00:00 2001 From: Kai Vogelgesang Date: Wed, 8 Jul 2020 13:39:56 +0200 Subject: [PATCH 2/2] Remove breakpoints --- kai/woodfarm.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/kai/woodfarm.lua b/kai/woodfarm.lua index ef547e1..ee44345 100644 --- a/kai/woodfarm.lua +++ b/kai/woodfarm.lua @@ -158,8 +158,6 @@ local state_machine = { end turtle.digUp() if T.state.y == TREE_MAX_Y - 1 then - print("below last log") - breakpoint() -- we are below the last log, no need to move up break end @@ -200,8 +198,6 @@ local state_machine = { ["OUTPUT"] = function() - breakpoint() - greedy_move(OUTPUT_TARGET.x, OUTPUT_TARGET.z, OUTPUT_TARGET.o) -- Drop all logs @@ -218,8 +214,6 @@ local state_machine = { ["RESUPPLY_SAPS"] = function() - breakpoint() - greedy_move(SAPS_TARGET.x, SAPS_TARGET.z, SAPS_TARGET.o) turtle.select(SAP_SLOT) @@ -233,8 +227,6 @@ local state_machine = { ["RESUPPLY_FUEL"] = function() - breakpoint() - greedy_move(FUEL_TARGET.x, FUEL_TARGET.z, FUEL_TARGET.o) if turtle.getFuelLevel() < FUEL_LEVEL_TARGET then