Moving Items across wired network

Started by Imaster, Jan 29, 2023, 04:21 PM

Previous topic - Next topic

Imaster

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

SquidDev

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:
  • peripheral.wrap("minecraft:chest_ID").pushItems(...)
  • peripheral.call("minecraft:chest_ID", "pushItems", ...)
  • peripheral.wrap("modem_side").callRemote("minecraft:chest_ID", "pushItems", ...)
GitHub | CC:Tweaked: A ComputerCraft fork | Plethora: A peripheral mod

Imaster

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

Lupus590

Drop the ID part of the string "minecraft:chest_2" is the correct format.

Imaster

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