From 50cecdee4d9348a38323f0b76fe49ca5a1570504 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Sat, 25 May 2024 23:57:21 +0200 Subject: [PATCH] feat(miner): add 3s delay at start --- miner.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/miner.lua b/miner.lua index 36a2e89..bdcd9a8 100644 --- a/miner.lua +++ b/miner.lua @@ -14,6 +14,7 @@ local MAX_Y = INITIAL_TARGET_Y + (config.height - 1) local MAX_Z = TARGET_Z local MIN_PERCENTAGE_NEEDED = 10 +local TIME_TO_START = 3 local miner = { robot = robotApi.create(), @@ -138,8 +139,12 @@ local function checkConfig() end end -local function minerStarted() +local function startMiner() turtle.select(1) + + print('Miner will starting in ' .. TIME_TO_START .. ' seconds...') + os.sleep(TIME_TO_START) + miner.started = true print("> Miner program started, minimum percentgae fuel needed: " .. MIN_PERCENTAGE_NEEDED) end @@ -344,7 +349,7 @@ if not miner.started then while not waitForUserConfirmation() do end end -minerStarted() +startMiner() saveMinerState() while not isProgramFinished() do