Advertisement
1vannn

f

Apr 6th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function wrapAll()
  2. local wrapped, names = {}, {}
  3. for _, name in ipairs(peripheral.getNames()) do
  4. table.insert(names, name)
  5. end
  6. for _, fn in ipairs(peripheral.getMethods(names[1])) do
  7. wrapped[fn] = function(...)
  8. local returns = {}
  9. for i = 1, #names do
  10. returns[i] = peripheral.call(names[i], fn, ...)
  11. end
  12. return returns
  13. end
  14. end
  15. return wrapped
  16. end
  17. a = peripheral.wrap(wrapAll())
  18. a.setLampColor(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement