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

Want to pullitem ...

Started by Mhaw, 15 September 2015 - 02:56 PM
Mhaw #1
Posted 15 September 2015 - 04:56 PM
Hi !
I want to pull the selected item of the turtule with itempull() but the turtle alaways push the first item of his inventory …
  • local side= peripheral.wrap("west")
  • turtle.select(2)
  • c.pullItem(side)
  • print("Done")

and i don't find any way in "search" …

Help me :'(
Bomb Bloke #2
Posted 16 September 2015 - 12:28 AM
The idea is that a turtle can't do this. However, with OpenPeripherals installed, you can rig up an external container as a peripheral and order the container itself to place the item into the turtle.

local container = peripheral.wrap(<side>)
container.pushItemIntoSlot(<direction>, <fromContainerSlot>, <amount>, <toTurtleSlot>)

So let's say the turtle is to the south of the container. You want to transfer at most 20 items from the container's third slot to the turtle's tenth slot. You'd do:

local container = peripheral.wrap(<side>)
container.pushItemIntoSlot("south", 3, 20, 10)