ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: Imaster on Jan 29, 2023, 04:21 PM

Title: Moving Items across wired network
Post by: Imaster on Jan 29, 2023, 04:21 PM
My goal is to move items using CC.

It is possible using pullItems() and pushItems() functions.
Unfortunately, it only works on peripheral.wrap(). And I'm looking for a way to pull/push to chests connected to modems connected into a single network.

I tied using modem.callRemote() but I'm unable to pass full method as it throws an error saying
"that method does not exist". Which is conflicting to information that I get using modem.getMethodsRemote("minecraft:chest_ID") which states that pullItems() is vailible method.

Did someone maybe know the fix or a workaround to this problem?

I'm using CC mod in my Vanilla+ there are no changes nor conflicts
Title: Moving Items across wired network
Post by: SquidDev on Jan 29, 2023, 04:56 PM
Quote from: Imaster on Jan 29, 2023, 04:21 PMUnfortunately, it only works on peripheral.wrap(). And I'm looking for a way to pull/push to chests connected to modems connected into a single network.
peripheral.wrap should still work for peripherals on a network. In fact, it's really just a wrapper over peripheral.call (which in turn just calls modem.callRemote).

So any of the following should work:
Title: Moving Items across wired network
Post by: Imaster on Jan 29, 2023, 05:13 PM
I tried to use

modem.callRemote("minecraft:chest_ID1" , ("pushItems(%s , %d)"):format("minecraft:chest_ID2", slot ) )

to execute move items but threw me an error
"No such method pushItems(minecraft:chest_ID2 , 1)"


before that I tried using
chest = peripherial.find("minecraft:chest_ID1")

chest.pushItem("minecraft:chest_ID2", slot)

which said that chest2 is null
I used peripherial.isPresent("minecraft:chest_ID2")
which said that chest2 is connected


I only managed to get pushItems() working by putting 2 chests directly at the sides of the computer
but it doesn't work if I connect them using modem
Title: Moving Items across wired network
Post by: Lupus590 on Jan 29, 2023, 06:13 PM
Drop the ID part of the string "minecraft:chest_2" is the correct format.
Title: Moving Items across wired network
Post by: Imaster on Jan 29, 2023, 07:45 PM
I put ID there because I access it using ("minecraft:chest_%d"):format(value)

I got I working for a moment but then broke it again
going to try again tomorrow
thanks for all the help