Upload files to 'crop-farm'

This commit is contained in:
Jan 2021-06-13 14:00:15 +00:00
parent 893bd7ca49
commit ffbaeb3a71

View file

@ -25,25 +25,8 @@ function refuel()
end end
end end
print("Started. "..HEIGHT.."x"..WIDTH.." area; Growth level "..GROWTH_MAX..".") function farm()
refuel()
-- Pull fuel from attached top inventory
if true then
turtle.select(1)
local data = turtle.getItemDetail()
if data then
local count = 64 - data.count
if count > 0 then
turtle.suckUp(count)
end
end
end
local turnLeft = false
for i = 0, WIDTH - 1 do
for j = 0, HEIGHT - 1 do
refuel()
turtle.forward() turtle.forward()
local success, data = turtle.inspectDown() local success, data = turtle.inspectDown()
@ -68,6 +51,27 @@ for i = 0, WIDTH - 1 do
turtle.select(2) turtle.select(2)
turtle.placeDown() turtle.placeDown()
end end
end
print("Started. "..HEIGHT.."x"..WIDTH.." area; Growth level "..GROWTH_MAX..".")
-- Pull fuel from attached top inventory
if true then
turtle.select(1)
local data = turtle.getItemDetail()
if data then
local count = 64 - data.count
if count > 0 then
turtle.suckUp(count)
end
end
end
local turnLeft = false
for i = 0, WIDTH - 1 do
for j = 0, HEIGHT - 1 do
farm()
end end
if i ~= WIDTH - 1 then if i ~= WIDTH - 1 then
@ -77,7 +81,7 @@ for i = 0, WIDTH - 1 do
turtle.turnLeft() turtle.turnLeft()
else else
turtle.turnRight() turtle.turnRight()
turtle.forward() farm()
turtle.turnRight() turtle.turnRight()
end end
turnLeft = not turnLeft turnLeft = not turnLeft