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,24 +25,7 @@ function refuel()
end end
end end
print("Started. "..HEIGHT.."x"..WIDTH.." area; Growth level "..GROWTH_MAX..".") function farm()
-- 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() refuel()
turtle.forward() turtle.forward()
@ -70,6 +53,27 @@ for i = 0, WIDTH - 1 do
end 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
if i ~= WIDTH - 1 then if i ~= WIDTH - 1 then
if turnLeft then if turnLeft then
turtle.turnLeft() turtle.turnLeft()
@ -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