Interacting with scripts

Individual scripts run in their own context, meaning they do not share variables with each other. By default there is always a global script context created, that is used for things like /ub lexec. When a script is first run, a new context is created just for that script, with its own Game api instance.

Using the Script Manager UI

The script manager ui provides controls for starting/stopping scripts, and a console for quickly running commands in the context of a specific script.

Using the command line

You can start / stop scripts from the command line using the /ub script command. To run lua in the context of a script, you can use the /ub lexecs command.

Script life cycle

Scripts started in game via the ui or command line will cease running when the current character logs out. If you want a script to run at the character select screen, it must be added to either global autoload scripts, or account autoload scripts settings. If you want a script to run every time a specific character logs in, add it to the character autoload scripts setting.

Only a single instance of a script can be running at any given time. If you list the same script in multiple autoload settings, it will only be started once. Attempting to start an already running script will stop the current script instance and then start a new one.

article sidebar here...