OC-PsychOS2/module/component-get.lua

9 lines
186 B
Lua
Raw Normal View History

function component.get(addr, ctype)
for c in component.list(ctype, true) do
if c:sub(1, addr:len()) == addr then
return c
end
end
return nil, "no such component"
end