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

Some help with peripheral functions in cc

Started by Taryon, 24 March 2014 - 10:08 PM
Taryon #1
Posted 24 March 2014 - 11:08 PM
Hi.
I have a computer. In its left (west) side a chest with 1 quad fuel rod uranium. (creative mode of course). And in the right side a reactor, all slots free.
in the lua interpreter I did:
p = peripheral.wrap("right")
p.pullItemIntoSlot("west", 1,1,1)

And all I got is 0 (zero).

If I put some depleted rod into reactor slot 1 and use the p.destroyStack(1), it works.

where am I wrong?

thx in advance

PS. I already use push and all direcions. same result.
Edited on 24 March 2014 - 11:30 PM
OReezy #2
Posted 25 March 2014 - 01:46 AM
The pull and push functions return the number of how many items were moved. When it says 0 its pretty much saying it failed to move anything. Now the reason it failed is because inventories need to be adjacent to each other. The chest needs to be touching the reactor.

You will need to wrap either the reactor or the chest with a wired modem. If you choose the chest use the peripheral proxy block to connect the modem to the chest.
Edited on 25 March 2014 - 03:15 PM
Bomb Bloke #3
Posted 25 March 2014 - 02:40 AM
That is to say, when you call a peripheral function, it's the peripheral that performs the action - not the computer.
Taryon #4
Posted 25 March 2014 - 10:19 AM
who knows knows

thanks a lot

Regards