Skip to main content

Connect To The Controller (LCC.connect)

Signature

ok = LCC.connect()

Parameters

  • none

Returns

  • ok
    Boolean. Returns true when the connection and version check succeed; otherwise false.

Notes

Loads configuration, completes initialisation, and reports the script state to the controller.
If the module version mismatches, it shows a prompt, downloads the latest LCC.lua, and hot-updates automatically.
On success caches the config and registers an exit callback to report is_running = false when the script terminates.
When no address was set via LCC.set_api_url() and the script is not launched by the controller, the function returns false immediately.

Example

if not LCC.connect() then
error("Unable to connect to the controller")
end