Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function modem.collectData(_sSide)
- local pSide
- local tData = {}
- local tSides = rs.getSides()
- function() for i = 1, #tSides do if _sSide == tSides[i] then return true end error("invalid side", 2) end
- if peripheral.isPresent(_sSide) and peripheral.getType(_sSide) == "modem" and not modem.isWireless(_sSide) then
- pSide = peripheral.wrap(_sSide)
- else
- error("no wired modem present on side: ".._sSide, 2)
- end
- local tConnections = pSide.getNamesRemote()
- for _, v in pairs(tConnections) do
- table.insert(tData, {["type"] = p.getTypeRemote(v), ["methods"] = p.getMethodsRemote(v)})
- end
- return tData
- end
Advertisement
Add Comment
Please, Sign In to add comment