Skip to content

Custom Actions

krazyito65 edited this page Jul 6, 2016 · 3 revisions

Custom Actions

The Custom Code section of the Actions tab can be used to execute custom Lua commands whenever a display is shown or hidden.

For a list of all commands that interact with the WoW client, see the WoW API. Note that some actions, like moving or casting spells, cannot be executed by Lua code.

For more information on Lua syntax, see Programming in Lua.

There is a special variable provided by WeakAuras that holds the UnitID of the unit currently being scanned for auras. This is really only useful for Group-based Aura triggers. For example, if you create a display with the following trigger settings:

The display's On Show Custom Code can be used to announce the name of the person on whom Beacon of Light is cast, with the following code:

local name = GetUnitName(WeakAuras.CurrentUnit)
SendChatMessage("Beacon of Light on ", "RAID")

Each custom action (OnInit, OnShow, OnHide) does not require a function to be used.

You can’t perform that action at this time.