Skip to content

Lua examples

Learn how SWTOR Lua combat routines make healing, movement and proc decisions. These excerpts from the official class scripts are followed by small addons and automation examples you can run or adapt.

Script recipes

Class Example What it does
Commando / Mercenary When to use Supercharge Time the heal reset and build the last stacks without running out of energy
Operative Cursor Holotraverse Choose a destination by aiming near its body center
Operative / Medicine Kolto Probe upkeep Keep two stacks and refresh them before they expire
Sage / Seer Predict who needs healing next Estimate future health and seconds until death from incoming damage
Sage / Sorcerer Presence of Mind and proc prediction Learn Throw tick timing, check PoM stacks and track Telekinetics' Tidal Force

Each example explains code from the class script. To run the full published package, use the Official Script Library route.

Small scripts

Start with the installation walkthrough. Each sample below links to its Lua file. Single Action also requires a shared helper; Bounded History is a module to load from an entry script.

Sample Use
Status panel Complete read-only entry point with settings
Incoming damage Bounded combat-stream reader with gap reporting
Single action Hold a key to attempt one configured ability; requires combat.ability_executor
Bounded history Plain Lua module independent of the game API

See module authoring to turn shared logic into your own module.