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

OpenPeripheral - item pull issue

Started by suuunly, 28 December 2013 - 10:16 AM
suuunly #1
Posted 28 December 2013 - 11:16 AM
Hi, I am trying to setup a compact system that converts tiny piles of dusts to regular dusts, which then get smelted
Anywho… what I'm using is an ME Interface, and a crafty turtle (whereas the ME Interface always tries to keep 9 pieces of tiny piles (of each type) )
everything works perfectly except for one thing, which is pulling the items out of the ME Interface using the OpenPeripherals:


meIntLocation = "top"
maxSize = 9 -- 9 tiny pile = 1 dust
getQuantity = "qty" -- the periperhal uses labelled values arrays

meInt = peripheral.wrap(meIntLocation)

function main()
	key, tStackInSlot = meInt.getStackInSlot(1)

	if(key ~= nil) then
		if(key[getQuantity] == 9) then
		   meInt.pullItemIntoSlot(meIntLocation, 0, maxSize, 0) -- zero based
	   end
	end
end

main()

This is a stripped down version of my code (down to the bare minimum), since I know for a fact, after a lot of testing, that the issue (code-wise) is with this line

meInt.pullItemIntoSlot(meIntLocation, 0, maxSize, 0) -- zero based

it just returns a 0 (bool value), which states (if done "correctly") that the procedure failed somehow

So I was wondering if some of you perhaps had some insight on this matter? :D/>
thx in advance! :D/>

NOTE: I'm currently using the Direwolf20 1.0.7 pack
Farrk #2
Posted 28 December 2013 - 06:06 PM
As far as I know as of 1.6.4 OpenPeripheral inventories start at 1, not 0 anymore.

@EDIT: sorry, aside of all inventories starting from 1, you need to use pushItemIntoSlot instead of pullItemIntoSlot to transfer items into adjacent inventories, and valid directions are "up","down","north","south","east","west". Also keep in mind that direction is relative to ME interface, not turtle/computer.

Edited on 28 December 2013 - 05:15 PM
suuunly #3
Posted 28 December 2013 - 06:31 PM
As far as I know as of 1.6.4 OpenPeripheral inventories start at 1, not 0 anymore.

@EDIT: sorry, aside of all inventories starting from 1, you need to use pushItemIntoSlot instead of pullItemIntoSlot to transfer items into adjacent inventories, and valid directions are "up","down","north","south","east","west". Also keep in mind that direction is relative to ME interface, not turtle/computer.


aaaah, yes, I see now, so the OpernPeriperals actually access the corrosponding objetct, and the commands therefor work out from the objects standpoint, not the one wrapping it :P/>
Thank you a bunch, everything is running smoothly now, and I will also use this newelly found knowladge elsewere xD
(Taking advantage ;)/> )

But again, thank you :)/>