system.registerSource¶
since 1.1.0
Register a Lua Source.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
params |
table | yes | see the fields below |
Fields of params:
key(string, 7 chars max): source keyname(string or function): source nameinit(function, optional): handler called on source initdone(function, optional): handler called on source stopwakeup(function, optional): handler called at each loopread(function, optional): optional read handlerwrite(function, optional): optional write handlerconfigure(function, optional): handler called on source configuration
Returns¶
Nothing.
Examples¶
From the official Ethos documentation
local function init()
system.registerSource({key="LuaSrc", name="My source", init=init, wakeup=wakeup})
end