great, that worked well.
I had the script in the wrong directory. As a module it executes as expected.
The loop function was only added, because an error was thrown without it, when placing the script in the storage directory. This also was resolved.
I was wondering though how to pass arguments to the configured action:
In the touchscreen frontend I used the connectionHandler.send method to trigger the action successfully, but was not able to access the payload:
//PrinterAction.ts
setLogEntry(slug: string, payload: object): Promise<any> {
return this.connectionHandler.send("logWrite", payload, slug);
}
the action in the lua script looks something like this:
--logs.lua
log = {}
...
log.write_log = function (payload)
...
end
...
server:registerAction('logWrite', log.write_log)
But trying to access the payload or registering the action with an argument was not successful. All I got was a memory pointer(?) like this "AccessContext (0xf691ccf0)" or this error:
"Call of rs:toJsonObject without table"