Include files, e.g. require keyword

Is there a way to include other lua files for a lua script, similar to the lua require keyword? Maybe I’m doing something wrong (I’m new to lua), but AP seems to treat each script independently, and the require keyword is either not supported or not handled as it would be in a lua env.

You cannot do this, as each script is “sandboxed” by the scripting engine by design. Your perception is correct.

Seems like a good candidate for further development. A well architected system, even a script, requires the support of file inclusion.

What are you trying to include? It is usually fairly trivial to work around the very intentionally placed constraint.

It may be trivial, but it’s unreasonable. The possibilities could not be exhausted here, but as an example: I’m creating a system to easily, and reasonably, manage and create led routines.

Well, I’m trying to help, but I can’t do so without some more information.

@iampete can shed more light on the developer rationale for the constraint as it exists (or if it is indeed as strict as I describe).

I do have a PR, its just not merged yet.

1 Like

Wonderful to see! What’s stopping it from being reviewed and merged in over a year?

All the other PRs that have been reviewed and merged. There are only so many hours in a day. I would like to get back to it soon.