Turtles, however, have no problem with goo, as any Eastman and Laird fan will know.
I'm sure there's a nice easy auto wheat farm program here somewhere, but here is my version. Solving problems myself is the whole point of ComputerCraft to me anyway.
Set up with Seeds, Bonemeal (or Sulfur Goo), and Wheat in that order, actually I don't think the Wheat is necessary. Bonemeal or Sulfur Goo is fetched from the chest in front of the turtle, and all Wheat and all surplus Seeds greater than 64 are deposited in the chest above.
http://pastebin.com/5kAt175V
pastebin get 5kAt175V farm
Spoiler
-- ****************************************************************************
-- ** FARM **
-- ****************************************************************************
local n = 0
local refilled = false
-- Fill the specified slot from any later slot that contains the same item, i.e. shuffle everything up to the topmost slots
local function fillSlot(slot)
local n = 0
if turtle.getItemSpace(slot) > 0 and turtle.getItemCount(slot) > 0 then
for n=16,slot+1,-1 do
turtle.select(n)
if turtle.compareTo(slot) then
turtle.transferTo(slot, turtle.getItemSpace(slot))
end
end
end
end
local function shuffleLoot()
local n=0
for n=1,15 do
fillSlot(n)
end
end
local function refillUp(slot)
local n=0
if turtle.getItemSpace(slot) > 0 then
-- Get more bonemeal or sulfur goo from the chest
refilled = false
n=slot+1
repeat
n=n+1
until n > 16 or turtle.getItemCount(n) == 0
if n <= 16 then
turtle.select(n)
turtle.suck()
-- don't want a full stack, so put some back
if turtle.getItemSpace(n) == 0 then
turtle.drop(turtle.getItemCount(2))
end
turtle.transferTo(slot, turtle.getItemSpace(2))
end
end
end
shuffleLoot()
refillUp(2)
-- Keep farming while there is still more than 1 fertilizer and free inventory space for at least 1 wheat
while turtle.getItemCount(2) > 1 and turtle.getItemSpace(15) > 0 and turtle.getItemSpace(16) > 0 do
while turtle.getItemCount(2) > 1 and turtle.getItemSpace(15) > 0 and turtle.getItemSpace(16) > 0 do
-- Use all but one of the seeds and bonemeal (or sulfur goo)
while turtle.getItemCount(1) > 1 and turtle.getItemCount(2) > 1 do
turtle.select(1)
turtle.placeDown()
sleep(.1)
turtle.select(2)
turtle.placeDown()
sleep(.1)
turtle.digDown()
turtle.suckDown()
-- sleep(.1)
-- turtle.suckDown()
end
-- Shuffle everything up to the top
shuffleLoot()
refillUp(2)
end
-- Unload into chest above, first all but one wheat in Slot 3
turtle.select(3)
turtle.dropUp(turtle.getItemCount(3)-1)
-- ...then everything else that doesn't match Slot 2 (bonemeal or sulfur goo)
for n=4,15 do
turtle.select(n)
if not turtle.compareTo(2) then
turtle.dropUp()
end
end
refillUp(2)
end
turtle.select(1)
Spoiler
Hm, I just let it run to a full inventory for the first time and it seems to quit at that point. Should be fairly simple to fix…
And I'm not entirely happy that I have the same condition on two While loops, I'll see if I can do something about that…
There, that's fixed the loop, it should now run on until the inventory is full of wheat and seeds, and then dump everything into the chest and start over.
It does more sorting than it needs to. Sorting is fairly quick now though.