Guest User

Untitled

a guest
Dec 29th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. arg = { ... }
  2. if #arg == 1 then
  3. subAspect = "Empty"
  4. subAspect = peripheral.call(arg[1],"getAspects")
  5. return
  6. end
  7. modem = peripheral.wrap("back")
  8. aspects = {}
  9. devices = peripheral.getNames()
  10. for i, device in pairs(devices) do
  11. if peripheral.getType( device ) == "tt_transvectorinterface" and peripheral.call(device,"isAspectContainer") then
  12. shell.run(shell.getRunningProgram(),device)
  13. jar = peripheral.wrap(device)
  14. aspect = subAspect
  15. count = jar.getAspectCount(aspect)
  16. if aspects[aspect] == nil then aspects[aspect] = count
  17. else aspects[aspect] = aspects[aspect] + count
  18. end
  19. end
  20. end
  21. print(textutils.serialize(aspects))
Advertisement
Add Comment
Please, Sign In to add comment