Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wrapAll()
- local wrapped, names = {}, {}
- for _, name in ipairs(peripheral.getNames()) do
- table.insert(names, name)
- end
- for _, fn in ipairs(peripheral.getMethods(names[1])) do
- wrapped[fn] = function(...)
- local returns = {}
- for i = 1, #names do
- returns[i] = peripheral.call(names[i], fn, ...)
- end
- return returns
- end
- end
- return wrapped
- end
- a = peripheral.wrap(wrapAll())
- a.setLampColor(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement