Posted 11 May 2013 - 02:42 PM
Does peripheral.getNames just use rs.getSides, then if it's a wired modem lists it's remote peripherals? I'm trying to sandbox it, so I need help.
local native = peripheral
function getNames()
local tResults = {}
for n,sSide in ipairs( rs.getSides() ) do
if native.isPresent( sSide ) then
table.insert( tResults, sSide )
if native.getType( sSide ) == "modem" and not native.call( sSide, "isWireless" ) then
local tRemote = native.call( sSide, "getNamesRemote" )
for n,sName in ipairs( tRemote ) do
table.insert( tResults, sName )
end
end
end
end
return tResults
end
Things you should know with figuring out this code: