remove check at the end of VP_splitstack and add some stuff to move
This commit is contained in:
17
src/main.lua
17
src/main.lua
@@ -309,22 +309,29 @@ local function move(direction, continousattempt)
|
|||||||
while true do
|
while true do
|
||||||
if turtle.getFuelLevel() == 0 then
|
if turtle.getFuelLevel() == 0 then
|
||||||
reset()
|
reset()
|
||||||
print("Out of fuel! Please insert fuel into current slot.")
|
print("Out of fuel! Trying to refuel.")
|
||||||
while true do
|
while true do
|
||||||
local suc = turtle.refuel(64)
|
local suc = turtle.refuel(64)
|
||||||
if suc then
|
if suc then
|
||||||
print("Refuelled. Press enter to continue.")
|
|
||||||
read("")
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
local current = turtle.getSelectedSlot()
|
||||||
|
if current == 16 then
|
||||||
|
turtle.select(1)
|
||||||
|
else
|
||||||
|
turtle.select(current+1)
|
||||||
|
end
|
||||||
os.sleep(1)
|
os.sleep(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local suc,reason = turtle[direction]()
|
local suc,reason = turtle[direction]()
|
||||||
if not suc and not continousattempt then
|
if not suc and not continousattempt then
|
||||||
printError(reason)
|
printError(reason)
|
||||||
print("Resolve the error and press enter to continue.")
|
print("Resolve the error and press enter to continue.")
|
||||||
read("")
|
read("")
|
||||||
|
elseif not suc and continousattempt then
|
||||||
|
reset()
|
||||||
|
printError("Failure moving "..direction.." Continous attempt true.")
|
||||||
elseif suc then
|
elseif suc then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -669,7 +676,7 @@ local function VP_splitstack(_stack, x)
|
|||||||
buf[i] = v
|
buf[i] = v
|
||||||
ind = ind + 1
|
ind = ind + 1
|
||||||
end
|
end
|
||||||
if #buf > 0 then table.insert(stacks, buf) end
|
table.insert(stacks, buf)
|
||||||
|
|
||||||
local out = {
|
local out = {
|
||||||
height=height,
|
height=height,
|
||||||
|
|||||||
Reference in New Issue
Block a user