From 77210784ff9a60ea4a3a66bfc221cca2d8fad4f0 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Wed, 22 May 2024 19:31:17 +0200 Subject: [PATCH] fix(inferium-harvester): handle when a turtle is blocked during forward --- inferium-harvester.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/inferium-harvester.lua b/inferium-harvester.lua index d8aad1a..0d21c7d 100644 --- a/inferium-harvester.lua +++ b/inferium-harvester.lua @@ -2,7 +2,7 @@ local net = require('libs/net') local utils = require('libs/utils') local turtleUtils = require('libs/turtle-utils') -local VERSION = "3.0.1" +local VERSION = "3.1.0" local INFERIUM_SERVER = 'inferium.com' local IDLE_TIME = 2 local WAIT_ITEM_IDLE_TIME = 5 @@ -244,8 +244,17 @@ end local function forward() - if not turtle.forward() then - error('turtle is blocked') + local blocked = false + + while not turtle.forward() do + if not blocked then + blocked = true + print('> turtle is blocked') + end + end + + if blocked then + print('turtle is unblocked') end end