Skip to content

Get items from a inventory with a turtle #1552

Answered by fatboychummy
poweron0102 asked this question in Q&A
Discussion options

You must be logged in to vote

You can wrap the chest as a peripheral even if its not on a modem. From there, you can pushitems to itself to move items around. If you move the item you want to slot 1, then turtle.suck() from the chest, you will get what you want in the turtle.

The caveat is that at least one slot must be available in the chest, otherwise you cannot move items around.

Example code:

--- Quick script to move a desired item in the chest to slot 1 (moving other items out of the way if needed)

--- Find an item in a chest, given the chest's position and item name.
---@param item_list itemList The list of items in the chest.
---@param item_name string The name of the item to find.
---@return integer? The slot…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@poweron0102
Comment options

Answer selected by poweron0102
Comment options

You must be logged in to vote
2 replies
@fatboychummy
Comment options

@devCacti
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants