From b7e5ff879e3b288184faafdbc5e9e9497109f0eb Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Sat, 13 Dec 2025 12:40:27 -0500 Subject: [PATCH 1/2] fix(mine.lua): fixed bug with moving to start_v in mine Turtle was mining too much, too soon --- mine.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mine.lua b/mine.lua index b2b46d8..1d91d63 100644 --- a/mine.lua +++ b/mine.lua @@ -254,6 +254,14 @@ function mine (block) local height = block.v2.y + offset local start_v = copy_v(block.v1) local end_v = block.v1 + block.v2 + if height > 2 then + start_v = start_v + UNIT_Y + end_v = end_v - UNIT_Y + elseif height < -2 then + start_v = start_v - UNIT_Y + end_v = end_v + UNIT_Y + end + moveAbs(start_v) if height % 3 == 0 then mode.mine = { up = true, forward = true, down = true } elseif height == 2 then @@ -263,14 +271,6 @@ function mine (block) mode.mine = { forward = true, down = true } end_v = end_v + UNIT_Y end - if height > 2 then - start_v = start_v + UNIT_Y - end_v = end_v - UNIT_Y - elseif height < -2 then - start_v = start_v - UNIT_Y - end_v = end_v + UNIT_Y - end - moveAbs(start_v) moveAbs(end_v) end From 9a8f81e428bb1316b8628dfe1897e7a111e753f7 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Sat, 13 Dec 2025 12:40:45 -0500 Subject: [PATCH 2/2] fix(mine.lua): implemented unimplemented function --- mine.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mine.lua b/mine.lua index 1d91d63..e680822 100644 --- a/mine.lua +++ b/mine.lua @@ -286,6 +286,9 @@ function splitHorizontal (block) -- Future work: potentially split a large block into smaller blocks -- based on currentPos (think splitting down the middle instead of -- splitting off of one end) + local differentSigns = function (a, b) + return math.abs(a + b) < math.abs(a) + math.abs(b) + end local bigBlock = function (block) return (block.v2.x >= BIG_DIM) and (block.v2.z >= BIG_DIM) end