tSides = { "top","bottom","back","left","right","front" } for i = 1,#tSides do if peripheral.getType( tSides[i] ) == "modem" then rednet.open( tSides[i] ) end end