58 posts
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?
64 posts
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
58 posts
Posted 04 March 2014 - 10:03 PM
oohh nice thanks
756 posts
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.