Main.lua

Every Translator component contains an entrypoint, the main.lua module.

This module contains the main .

When you start a component, the Translator runs through the entire script in main.lua. Every time a running component receives a message, the main function is called.

One thing to note is that variables are initialized at different times depending on where they are declared.

  • Variables declared outside the main function are initialized once when the component is started.

  • Variables declared within the main function are initialized every time a message is processed by the running component.

Â