Jump to content




Some help with peripheral functions in cc

peripheral computer

  • You cannot reply to this topic
3 replies to this topic

#1 Taryon

  • Members
  • 7 posts

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 by Taryon, 25 March 2014 - 12:30 AM.


#2 OReezy

  • Members
  • 91 posts

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 by OReezy, 25 March 2014 - 04:15 PM.


#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.

#4 Taryon

  • Members
  • 7 posts

Posted 25 March 2014 - 10:19 AM

who knows knows

thanks a lot

Regards





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users