diff --git a/src/main.lua b/src/main.lua index 5207e0a..0a8a2d3 100644 --- a/src/main.lua +++ b/src/main.lua @@ -309,22 +309,29 @@ local function move(direction, continousattempt) while true do if turtle.getFuelLevel() == 0 then reset() - print("Out of fuel! Please insert fuel into current slot.") + print("Out of fuel! Trying to refuel.") while true do local suc = turtle.refuel(64) if suc then - print("Refuelled. Press enter to continue.") - read("") break end + local current = turtle.getSelectedSlot() + if current == 16 then + turtle.select(1) + else + turtle.select(current+1) + end os.sleep(1) - end + end end local suc,reason = turtle[direction]() if not suc and not continousattempt then printError(reason) print("Resolve the error and press enter to continue.") read("") + elseif not suc and continousattempt then + reset() + printError("Failure moving "..direction.." Continous attempt true.") elseif suc then break end @@ -669,7 +676,7 @@ local function VP_splitstack(_stack, x) buf[i] = v ind = ind + 1 end - if #buf > 0 then table.insert(stacks, buf) end + table.insert(stacks, buf) local out = { height=height,