Jump to content




Using a turtle to milk a cow


  • You cannot reply to this topic
2 replies to this topic

#1 ASPEEDYNINJA

  • New Members
  • 1 posts

Posted 26 October 2013 - 05:36 PM

Title:Using a turtle to milk a cow

I am trying to use a turtle to milk a cow so that i can automate the collection of milk. So far i have been able to get most of it working the only think i cant get to work is the filling of the filling of the buckets.
The problem is when it sucks buckets because they now stack it can pick up more then one, i dont know how to make it only suck one or the way i was trying to get it to work was to count how many buckets it has then milk the cow the right amount of times depending on the amount of buckets.

here is my code please don't judge me i'm new to this so it might be a bit messy :P

function suck()
while not turtle.suck() do
sleep(1)
end
end

function getBucket()
turtle.turnLeft()
suck()
turtle.turnRight()
end

function dropMilk()
turtle.turnRight()
turtle.turnRight()
for vSlot = 1, 16, 1 do
turtle.select(vSlot)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
end

function milk()
turtle.select(1)
turtle.getItemCount(1) = i
for i do
turtle.place()
end

while true do
getBucket()
milk()
dropMilk()
sleep(1)
end

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 26 October 2013 - 06:21 PM

Split into new topic.

You'd need to use i = turtle.getItemCount(1), not the other way around. You can call turtle.drop with a number argument to tell it how many items to drop:

turtle.suck()
turtle.drop(turtle.getItemCount(1) - 1)


#3 awsmazinggenius

  • Members
  • 930 posts
  • LocationCanada

Posted 28 October 2013 - 07:01 PM

Just curious. Can you actually farm milk with a Turtle? I didn't know it was possible.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users