First commit. Not even working prototype yet.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
local componentlib = {}
|
||||
|
||||
function componentlib.get(address)
|
||||
checkArg(1, address, "string")
|
||||
assert(#address >= 3, "abbreviated address must be at least 3 characters long")
|
||||
local components = component.list()
|
||||
for currentAddress, name in pairs(components) do
|
||||
if currentAddress:find("^" .. address) then
|
||||
return(currentAddress)
|
||||
end
|
||||
end
|
||||
return nil, "full address not found"
|
||||
end
|
||||
|
||||
componentlib.invoke = component.invoke
|
||||
|
||||
return(componentlib)
|
||||
Reference in New Issue
Block a user