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

Detecting peripherals on wired modem

Started by makeme, 04 March 2014 - 08:45 PM
makeme #1
Posted 04 March 2014 - 09:45 PM
I want to be able to detect tanks on a network using openp how can i make it automatic so it doesnt matter on its name?
Termanater13 #2
Posted 04 March 2014 - 09:59 PM
check out peripheral.getNames() it returns a table listing all the names of attached network peripherals as well as ones on the side of the computer.
http://www.computercraft.info/wiki/Peripheral.getNames
makeme #3
Posted 04 March 2014 - 10:03 PM
oohh nice thanks
Anavrins #4
Posted 05 March 2014 - 06:35 PM
Assuming "local p = peripheral.wrap(side)" is wrapping a wired modem
You can get all the wired peripherals with the "p.getNamesRemote()" method.
That doesn't include peripherals placed beside the computer.