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

Wrapping All Available Peripherals

Started by Inumel, 04 October 2013 - 06:38 PM
Inumel #1
Posted 04 October 2013 - 08:38 PM
Hello pro's and other people who randomly skim these(I am one of them..)

I am looking for a way to wrap all available peripherals on a network cable without having to do so manually, I couldn't think of a way to do this myself, if its even possible.. But I figured if theres a place to find out it would be here!

I want it to auto-detect the addition/removal of a new peripheral and add it accordingly, sadly I have no idea where to even start with this one :s
HurricaneCoder #2
Posted 04 October 2013 - 09:26 PM
Ok now I know what you mean. Before I thought you just want to wrap the different peripheral on different side.
theoriginalbit #3
Posted 04 October 2013 - 09:27 PM
There is no way to "wrap all" peripherals on a network.

What you can do though is you can make a table of the wrapped peripherals then have a function do a generic call out to any peripheral that can accept the message.

In the peripheral API there is a function called getNames, this is the names of all the peripherals both attached to the computer directly and via a wired network.

As for the detection of adding or removing peripherals there are events (peripheral and peripheral_detach) for those so you could easily make your program listen out for those.
Lyqyd #4
Posted 04 October 2013 - 10:01 PM
You may find that reading through this topic is instructive.