Skip to main content

Overview

WeakAuras uses several data structures to store aura configuration, trigger states, and runtime information.

Core Tables

WeakAurasSaved

The main SavedVariables table containing all persistent data.
displays
table
All aura configurations, keyed by aura ID
registered
table
Registered aura information
minimap
table
Minimap icon configuration
features
table
Feature flags
login_squelch_time
number
Time in seconds to squelch actions after login (default: 10)
local db = WeakAurasSaved
for id, auraData in pairs(db.displays) do
  print("Aura:", id)
end

Aura Data Structure

Each aura in WeakAurasSaved.displays has the following structure:

Core Properties

id
string
Unique identifier for the aura
uid
string
Universal unique identifier
regionType
string
Region type: “icon”, “text”, “progresstexture”, “model”, “group”, “dynamicgroup”
parent
string
Parent group ID if this aura is in a group
url
string
Wago.io URL if imported from Wago
version
number
Aura version number

Trigger Configuration

triggers
table
Array of trigger configurations
data.triggers = {
  [1] = {
    trigger = {
      type = "aura2",
      subeventPrefix = "SPELL",
      event = "Health",
      unit = "player",
      -- ... trigger-specific settings
    },
    untrigger = {
      -- Untrigger configuration
    }
  }
}

Actions

actions
table
Actions to perform on different events
data.actions = {
  init = {
    do_custom = false,
    custom = "",
  },
  start = {
    do_sound = false,
    sound = "",
    do_custom = false,
    custom = "",
    do_message = false,
    message = "",
  },
  finish = {
    do_sound = false,
    sound = "",
    do_custom = false,
    custom = "",
  }
}

Conditions

conditions
table
Array of condition configurations
data.conditions = {
  [1] = {
    check = {
      trigger = 1,
      variable = "show",
      value = 1
    },
    changes = {
      [1] = {
        property = "alpha",
        value = 0.5
      }
    }
  }
}

Load Conditions

load
table
Load conditions determining when the aura is loaded
data.load = {
  use_never = false,
  use_class = true,
  class = {
    single = "DEATHKNIGHT",
    multi = {}
  },
  use_spec = true,
  spec = {
    single = 1,
    multi = {}
  },
  size = {
    multi = {}
  }
}

Trigger State Structure

Trigger states contain the current runtime state of a trigger.

Common State Properties

show
boolean
Whether the aura should be shown
changed
boolean
Whether the state has changed
progressType
string
Progress type: “timed” or “static”

Timed Progress Properties

duration
number
Total duration in seconds
expirationTime
number
GetTime() value when the timer expires
autoHide
boolean
Whether to auto-hide on expiration
paused
boolean
Whether the timer is paused
remaining
number
Remaining time when paused
inverse
boolean
Whether to display progress inversely

Static Progress Properties

value
number
Current value
total
number
Maximum value

Display Properties

name
string
Display name
icon
string
Icon texture path or spell ID
texture
string
Texture path
stacks
number
Stack count

Unit Tables

WeakAuras provides pre-populated unit tables for common use cases.

Raid Units

WeakAuras.raidUnits = {
  [1] = "raid1",
  [2] = "raid2",
  -- ... up to raid40
}

Party Units

WeakAuras.partyUnits = {
  [1] = "party1",
  [2] = "party2",
  [3] = "party3",
  [4] = "party4"
}

Pet Units

WeakAuras.petUnitToUnit = {
  pet = "player",
  raidpet1 = "raid1",
  partypet1 = "party1",
  -- ...
}

WeakAuras.unitToPetUnit = {
  player = "pet",
  raid1 = "raidpet1",
  party1 = "partypet1",
  -- ...
}

Region Tables

Private.regions

Table of all active regions.
local Private = select(2, ...)
for id, regionData in pairs(Private.regions) do
  local region = regionData.region
  local regionType = regionData.regionType
  print(id, regionType)
end

Private.regionTypes

Registered region type definitions.
create
function
Function to create a new region
modify
function
Function to modify an existing region
default
table
Default configuration values
properties
table
Region properties for conditions
local iconType = Private.regionTypes["icon"]
if iconType then
  local defaults = iconType.default
  print("Default width:", defaults.width)
end

Trigger System Tables

Private.triggerTypes

Maps trigger types to their handler systems.
local Private = select(2, ...)
local triggerSystem = Private.triggerTypes["aura2"]
if triggerSystem then
  -- BuffTrigger system
end

Animation Tables

Private.anim_presets

Pre-defined animation configurations.
local presets = Private.anim_presets
local fadeAnim = presets.fade
-- {
--   type = "custom",
--   duration = 0.25,
--   use_alpha = true,
--   alpha = 0
-- }

See Also

Build docs developers (and LLMs) love