Posted 23 December 2012 - 12:10 PM
I am trying to make a simple turtle farm that just places down seeds, uses bonemeal, and picks it up until it has enough wheat.
Help is appreciated!
Thanks! :D/>
wheat = turtle.getItemCount(3) -- where wheat is kept
bone = turtle.getItemCount(2) -- this is where the bonemeal is kept until it runs out and the last wheat comes in
both = wheat + bone
function drop()
turtle.turnLeft()
turtle.select(3)
turtle.drop()
turtle.select(1)
turtle.turnRight()
print("I'm done!")
sleep(10)
os.reboot()
end
function farm()
while wheat ~= 32 do
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
turtle.dig()
wheat = turtle.getItemCount(3)
if both == 32 then
if turtle.compareTo(13) then --compares wheat to wheat in slot 13
turtle.select(2) -- select the wheat that is in the wrong spot
turtle.transferTo(3)
drop()
end
end
end
end
if bone == 0 then
print("Gotta get some bonemeal!")
turtle.turnLeft()
turtle.turnLeft()
turtle.suck(2)
turtle.turnLeft()
turtle.turnLeft()
farm()
else
farm()
end
My first problem was that when it used the last bonemeal it would put the wheat in the wrong spot and it would not drop because it would never have 32 wheat. To fix this I just said that if the place where the wheat is supposed to be and the slot where it is not supposed to be add up to 32 then put them in the same slot and put them in the chest. This works, but only when it doesn't have to get bonemeal. If it has to turn around and get bonemeal then it won't drop the wheat. Anyone know why it does this?Help is appreciated!
Thanks! :D/>