SuicidalSTDz

Modem

Jul 13th, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function modem.collectData(_sSide)
  2. local pSide
  3. local tData = {}
  4. local tSides = rs.getSides()
  5.  
  6. function() for i = 1, #tSides do if _sSide == tSides[i] then return true end error("invalid side", 2) end
  7. if peripheral.isPresent(_sSide) and peripheral.getType(_sSide) == "modem" and not modem.isWireless(_sSide) then
  8. pSide = peripheral.wrap(_sSide)
  9. else
  10. error("no wired modem present on side: ".._sSide, 2)
  11. end
  12.  
  13. local tConnections = pSide.getNamesRemote()
  14. for _, v in pairs(tConnections) do
  15. table.insert(tData, {["type"] = p.getTypeRemote(v), ["methods"] = p.getMethodsRemote(v)})
  16. end
  17.  
  18. return tData
  19. end
Advertisement
Add Comment
Please, Sign In to add comment