This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MoksliukasM's profile picture

[1.4] Turtle, farming wheats, crafting bread.

Started by MoksliukasM, 18 September 2012 - 06:50 AM
MoksliukasM #1
Posted 18 September 2012 - 08:50 AM
Hi, i'm a rookie on this mod, but I created a program. This program can plant seeds, take wheats and craft a bread!

PasteBin: http://pastebin.com/WR2R0LSP

Raw code:

for m=1,3 do
   turtle.dig()
   turtle.turnRight()
   turtle.suck()
end
turtle.dig()
number = 4
turtle.turnRight()
function wheat()
   number = number + 1
   turtle.select(2)
   turtle.dropUp(1)
   turtle.select(number)
   turtle.suckUp()
   --os.sleep(10)
end
wheat()
wheat()
wheat()
turtle.select(1)
turtle.dropUp()
turtle.select(2)
turtle.dropUp()
turtle.select(16)
turtle.dropUp()
if not turtle.craft() then
   print "Don't know a problem"
else
   turtle.craft()
   print "Crafted bread."
end
turtle.select(1)
turtle.suckUp()
turtle.select(2)
turtle.suckUp()
turtle.select(1)
for i=1,3 do
   turtle.dig()
   turtle.place()
   turtle.turnRight()
end
turtle.dig()
turtle.place()


How to use that:

First place a chest and crafty farming turtle under chest. Like this http://imgur.com/WTfmZ . In turtle first slot place min 4 seeds and in second slot place 3 wheats. Like this http://imgur.com/1eEOr. Then run program, first it's plants a seeds. Then, if you wanna test it, grow the wheat with bone meal and run the program again. It's take the wheats and craft's a bread.
MoksliukasM #2
Posted 14 October 2012 - 09:23 AM
No comments? Are my program that lame? :)/>/>
ChunLing #3
Posted 14 October 2012 - 12:35 PM
You posted in the middle of the night. It's not surprising that nobody had replied before the witching hour. Nobody's replied to my program post for a couple of days. I would say I know how you feel, but I can't even imagine how impatient you must feel.

Anywho…it looks like an okay program. But there isn't a lot of tolerance for error and there are some oddities. You should make sure to drop everything except your crafting ingredients before trying to craft bread. And you should only bother to try crafting bread when you get a turtle.getItemCount() results high enough to matter (and work at all). You also only need to call turtle.craft once before rearranging/restocking your inventory.

What kind of results are you getting from this program?