fix(tunnels-miner): bad orientation + crash

This commit is contained in:
Guillaume ARM 2024-05-26 04:05:00 +02:00
parent 4091084bea
commit 12a50ebf6a

View File

@ -6,7 +6,7 @@ local TIME_TO_START = 3
local IDLE_TIME_BETWEEN_TUNNELS = 1 local IDLE_TIME_BETWEEN_TUNNELS = 1
local SPACE_BETWEEN_TUNNELS = 3 local SPACE_BETWEEN_TUNNELS = 3
local VERSION = "1.0.2" local VERSION = "1.0.3"
local MOVES_BY_DIRECTION = { local MOVES_BY_DIRECTION = {
right = { right = {
@ -97,7 +97,7 @@ end
local function dropAllProcedure(config) local function dropAllProcedure(config)
turtleUtils.forceDown() turtleUtils.forceDown()
getMoves(config).turnLeft() getMoves(config).turnRight()
-- try to refuel before dropping items -- try to refuel before dropping items
turtleUtils.refuel(getMinFuelNeeded(config), turtle.suck, IDLE_TIME) turtleUtils.refuel(getMinFuelNeeded(config), turtle.suck, IDLE_TIME)
@ -116,12 +116,12 @@ local function dropAllProcedure(config)
end end
end end
getMoves(config).turnRight() getMoves(config).turnLeft()
turtleUtils.forceUp() turtleUtils.forceUp()
end end
local function goToNextMineProcedure(config) local function goToNextMineProcedure(config)
getMoves(config).turnRight() getMoves(config).turnLeft()
digForward(SPACE_BETWEEN_TUNNELS) digForward(SPACE_BETWEEN_TUNNELS)
getMoves(config).turnLeft() getMoves(config).turnLeft()
end end
@ -143,7 +143,7 @@ local function main(config)
local tunnelNumber = 1 local tunnelNumber = 1
while true do while true do
if tunnelNumber > 1 then if tunnelNumber > 1 then
printFuelReport() printFuelReport(config)
assertEnoughFuelForTunnel(config) assertEnoughFuelForTunnel(config)
end end
assertInventoryIsEmpty() -- Warning here when implementing persistance assertInventoryIsEmpty() -- Warning here when implementing persistance