Jump to content




Can i make a turtle suck an item out of a chest?


6 replies to this topic

#1 fatmanguy88

  • New Members
  • 6 posts

Posted 20 January 2013 - 07:49 AM

I want to make a turtle suck saplings and bonemeal out of a chest and place it in his second and third slot? Is this possible? and if so how do i do it?

#2 W00dyR

  • Members
  • 135 posts

Posted 20 January 2013 - 07:53 AM

use the turtle functions

turtle.suck()

and

turtle.transferTo(slot, quantity)

if they are in the wrong slots

#3 FF0084

  • New Members
  • 10 posts
  • LocationPoland

Posted 20 January 2013 - 07:54 AM

Turtle functions

Function turtle.suck() is the one you're looking for. If you want to place these items in nth slot, make sure it's selected first (turtle.select(...)) and that it's empty (turtle.getItemCount(...) == 0), otherwise it'll land in the next free slot.

#4 fatmanguy88

  • New Members
  • 6 posts

Posted 20 January 2013 - 08:05 AM

View PostFF0084, on 20 January 2013 - 07:54 AM, said:

Turtle functions

Function turtle.suck() is the one you're looking for. If you want to place these items in nth slot, make sure it's selected first (turtle.select(...)) and that it's empty (turtle.getItemCount(...) == 0), otherwise it'll land in the next free slot.
Alright cool, can i make him suck out a specific item like lets say in the chest there is 4 items, in the first slot cobble stone, in the second saplings, in the third bonemeal, and in the forth wood, can i make the turtle suck out the second and third slots only?

#5 W00dyR

  • Members
  • 135 posts

Posted 20 January 2013 - 08:10 AM

View Postfatmanguy88, on 20 January 2013 - 08:05 AM, said:

View PostFF0084, on 20 January 2013 - 07:54 AM, said:

Turtle functions

Function turtle.suck() is the one you're looking for. If you want to place these items in nth slot, make sure it's selected first (turtle.select(...)) and that it's empty (turtle.getItemCount(...) == 0), otherwise it'll land in the next free slot.
Alright cool, can i make him suck out a specific item like lets say in the chest there is 4 items, in the first slot cobble stone, in the second saplings, in the third bonemeal, and in the forth wood, can i make the turtle suck out the second and third slots only?

You can only make it suck out a certain number of items, not from a certain slot

However, you can do something like,

for i = 1, 3 do
   turtle.suck()
end
turtle.select(1)
turtle.drop()

this sucks out 3 times, so the first, second and third slot
then it selects the first slot (the first item it sucked out of the chest) and dumps it back

#6 FF0084

  • New Members
  • 10 posts
  • LocationPoland

Posted 20 January 2013 - 08:11 AM

I'm afraid you have no control when sucking the items. The turtle receives the item from a non-empty slot with the lowest index ( i.e. if slot 1 is empty and slot 2 is filled, it picks the slot 2 ).

#7 fatmanguy88

  • New Members
  • 6 posts

Posted 20 January 2013 - 08:14 AM

View PostW00dyR, on 20 January 2013 - 08:10 AM, said:

View Postfatmanguy88, on 20 January 2013 - 08:05 AM, said:

View PostFF0084, on 20 January 2013 - 07:54 AM, said:

Turtle functions

Function turtle.suck() is the one you're looking for. If you want to place these items in nth slot, make sure it's selected first (turtle.select(...)) and that it's empty (turtle.getItemCount(...) == 0), otherwise it'll land in the next free slot.
Alright cool, can i make him suck out a specific item like lets say in the chest there is 4 items, in the first slot cobble stone, in the second saplings, in the third bonemeal, and in the forth wood, can i make the turtle suck out the second and third slots only?

You can only make it suck out a certain number of items, not from a certain slot

However, you can do something like,

for i = 1, 3 do
   turtle.suck()
end
turtle.select(1)
turtle.drop()

this sucks out 3 times, so the first, second and third slot
then it selects the first slot (the first item it sucked out of the chest) and dumps it back
Alright cool, thank you very much this has been helpful.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users