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

[OpenPeripheral] pushItem/pullItem not working

Started by negamartin, 03 June 2014 - 10:31 PM
negamartin #1
Posted 04 June 2014 - 12:31 AM
Okay, so I've got a chest on the west side of a computer, and one on the east.
The computer's front is facing to the south, so right is the chest on the east.
Like this:


I put a sign in the top-left slot in the right chest and i dis in the lua program:

c=peripheral.wrap("right"); --East chest
c.pushItem("west",1);
The pushItem doesn't return anything and the sign doesn't move to the left(west).
Btw, peripheral.getType("right") and peripheral.getType("left") both return "container_chest"

It should move it, right?
c.getStackInSlot(1) returns:
{
id = 323,
name = "Sign",
maxdmg = 0,
rawName = "item.sign",
dmg = 0,
maxSize = 16,
ench = {},
qty = 1
}


EDIT: BTW, pushItem("left",1) just says "invalid direction"
Edited on 03 June 2014 - 10:32 PM
Lyqyd #2
Posted 04 June 2014 - 12:49 AM
The push/pull directions are relative to the inventory being manipulated, not the computer.
apemanzilla #3
Posted 04 June 2014 - 01:57 PM
Also, they can't push "through" computers, only to inventories next to them. So even the right direction still wouldn't work.
negamartin #4
Posted 04 June 2014 - 09:48 PM
Yay, it works!
However, on double chests doing something like this:

DDC

D=Double Chest Block C=Single Chest

And pushing an item from the double chest to the single chest just moves the item in the double chest to slot #2 if the item was initially in slot #1 and anywhere else it moves to the slot #1. It never changes chest, not even changes to slot #28, which should be the double chest on the right…
Edited on 04 June 2014 - 08:01 PM
theoriginalbit #5
Posted 05 June 2014 - 02:18 AM
okay that could be a bug. what version of OpenPeripheral are you using?
negamartin #6
Posted 05 June 2014 - 02:33 AM
OpenPeripheralCore 0.4.0
and just in case it matters, I've got OpenPeripheralAddons 0.1.4
theoriginalbit #7
Posted 05 June 2014 - 03:25 AM
okay thank you. I took a look into our code and I think I've discovered the problem, I've made an issue here to see if one of the other guys knows the best way to fix it as I'm not completely sure. Keep an eye on that issue for a resolution :)/>
negamartin #8
Posted 05 June 2014 - 05:13 AM
Okay, I'll keep an eye