Core Functions
Add
Adds a display and creates all internal data structures for all triggers.The aura data structure containing trigger configuration
Delete
Deletes all triggers for a display ID.The display ID to delete
Rename
Updates all trigger information from old ID to new ID.The old display ID
The new display ID
LoadDisplay
Loads all triggers of a display ID.The display ID to load
LoadDisplays
Loads multiple displays and registers necessary events.Map of display IDs to load
Optional event that triggered the load
Additional event arguments
UnloadAll
Unloads all triggers and clears all data.UnloadDisplays
Unloads specific displays.Map of display IDs to unload
Modernize
Modernizes all generic triggers in data to current format.The aura data to modernize
Helper Functions
These functions are mainly for WeakAuras Options.GetOverlayInfo
Returns a table containing the names of all overlays.The aura data
The trigger number
Table of overlay names
CanHaveTooltip
Returns the type of tooltip to show for the trigger.The aura data
The trigger number
Type of tooltip (“spell”, “item”, “unit”, etc.)
GetNameAndIcon
Returns the name and icon to show in the options.The aura data
The trigger number
Display name for the trigger
Texture path for the icon
GetAdditionalProperties
Returns a tooltip for the additional properties.The aura data
The trigger number
Tooltip text describing additional properties
GetProgressSources
Fills outValues with the potential progress sources.The aura data
The trigger number
Table to fill with progress sources
GetTriggerConditions
Returns potential conditions that this trigger provides.The aura data
The trigger number
Array of condition definitions
Event Scanning Functions
ScanEvents
Scans for matching triggers on a game event.The event name
Event arguments
ScanUnitEvents
Scans for matching triggers on a unit-specific event.The event name
The unit token
Additional event arguments
CreateFakeStates
Creates fake trigger states for options preview.The display ID
The trigger number
Trigger Counter
Trigger counters track event occurrences and can match specific counts or patterns.CreateTriggerCounter
Creates a new trigger counter with optional pattern matching.Cron-like pattern for matching counts (e.g., “2,5,6” or “2-6” or “2/3”)
Counter object with methods:
Reset()- Resets count to 0GetNext()- Increments and returns current countSetCount(count)- Sets current countMatch()- Returns true if current count matches pattern
Examples
Basic Trigger Setup
Event Counter Pattern
Custom Event Handling
See Also
- BuffTrigger System - Specialized buff/debuff triggers
- Events - Core event system
- Tables - Data structures including trigger states