* feat(macro): native #showtooltip/#show, conditional /cast and /use
Backport the macro display system to the engine:
- Macro::ShowTooltip resolves `#showtooltip [cond] value` / `#show` (and
the bare form over the macro's /cast and /use lines, first match wins)
through the Lua SecureCmdOptionParse on the world tick and writes the
result into the engine's per-macro spell cache (+0x564/+0x568), which
every action reader already consumes. Repaints go through the engine's
own slot-changed notifier. Item targets are cached alongside.
Re-evaluates on modifier / mouseover / target / combat changes and every
200 ms otherwise. Yields entirely when SuperCleveRoidMacros is loaded.
- The `?` icon rule is a co-hook on the macro icon getter, so action
buttons and the drag cursor both show the resolved icon; GetMacroInfo,
GameTooltip:SetAction, GetActionCooldown, GetActionCount and
IsConsumableAction are re-registered in front of the engine for macro
slots with a resolved directive and tail-call it otherwise.
- Macro::RunBody re-implements the engine's body runner so `#` lines
never reach chat; Macro::Execute skips them too.
- /cast and /use in the embedded addon (3.3.5 handler shape): items
first, [@unit] via C_Spell.CastAtUnit, 1..19 = inventory slot, other
numbers stay spellIDs. SecureCmdOptionParse: a group whose only piece
is @unit passes only while the unit exists (3.3.5 passes it
unconditionally). C_Item.GetItemCount accepts names. GetMacroItem
added; GetMacroSpell now reflects the directive.
- Offsets.h: 0x004F0F40 was the macroID -> MacroEntry resolver,
mislabeled as a spell-state cache; renamed FUN_MACRO_ID_TO_ENTRY, with
the action-bar / macro-runner constants this needs added and verified.
* feat(unit): add IsUnitToken for token-vs-name dispatch
Vanilla ships each "act on a unit" verb as two Lua entries, one taking a
unit token and one taking a character name, and each errors on the other
kind of input. Conditional slash commands need to accept either, because
SecureCmdOptionParse hands back a token for `/target [@focus]` and a name
for `/target Bob` through the same variable.
IsUnitToken(value) answers which one a string is by calling the engine's
own token resolver inside lua_pcall and reporting whether it returned or
threw. Consulting the resolver rather than matching a token list here
keeps the answer correct for every family it knows, including this
client's native GUID literals and our own focus / nameplateN / markN,
which unit/TokenExtensions.cpp hooks onto the same function. It reports
whether the text names a token, not whether a unit is there, so "target"
with nothing targeted is still true.
if IsUnitToken(x) then TargetUnit(x) else TargetByName(x) end
Additive on purpose. Merging the pairs into a modern TargetUnit /
AssistUnit / FollowUnit was written and reverted: those names are common
enough for other DLLs and addons to replace that re-registration is
silently last-one-wins, with no error and no trampoline to chain. That
mechanism is only safe for names nobody else contends.
Offsets.h records two findings from decompiling the resolver. The throw
is raised by its callee, not by FUN_RESOLVE_UNIT_TOKEN, which is a thin
wrapper returning 0 on a miss. And this client reaches the error through
a patched fallthrough that first parses a 0x<hex> GUID literal, so GUID
unit tokens resolve natively with no SuperWoW loaded.
* feat(addon): backport the conditional slash commands
Adds 27 commands that take [conditions] through SecureCmdOptionParse,
following the 3.3.5 SecureCmdList handler shapes: targeting
(/targetexact, /cleartarget, /targetlasttarget, /targetlastenemy,
/targetenemy, /targetfriend, /targetenemyplayer, /targetfriendplayer,
/targetparty, /targetraid), casting and state (/stopcasting, /cancelaura,
/cancelform, /dismount), equipment (/equip, /equipslot), action bars
(/changeactionbar, /swapactionbar) and the pet family.
/target, /assist and /follow gain conditions by replacing the FrameXML
handlers, which is the only way to add them. Plain input keeps working:
each routes through IsUnitToken to the engine's token entry or its
by-name entry, where the old handler always went by name.
Three natives have a different shape here than the 3.3.5 handlers assume,
so those bodies are not straight ports. PetAttack takes no target and
always sends the pet at the current target. ChangeActionBarPage takes no
page and only fires ACTIONBAR_PAGE_CHANGED, so CURRENT_ACTIONBAR_PAGE is
set first. Pet autocast is a spellbook-slot toggle with no enable and
disable entries, so a name is resolved against the pet book and on/off
read the state and toggle only on a mismatch. /cancelaura needs no buff
walk, since CancelSpellByName already matches a player buff by name.
Not ported for want of a native: /targetlastfriend, and the /mt and /ma
family, which needs party assignments the client does not have.
Command names come from the locale files, with the localized name taken
from the matching Blizzard GlobalStrings and the English one alongside.
zhCN ships English for all 27. The short aliases retail also carries
(/eq, /tar) are left out, since those collide with addon shorthands.
* fix(macro): resolve item link values in #showtooltip
`#showtooltip` over a `/use item:6948` line showed no icon. The directive
evaluator built its item argument as `{0, 0, value}`, hardcoding the whole
value as a NAME, so the `item:N` and pasted-link forms could never match
and the value fell through to the spell lookup. `/use` itself was fine,
which is why the macro cast the item but the button stayed blank.
The link parsing already existed for the Lua entries. Split it out as
`Item::Arg::ResolveString` and call that instead of hand-building the
argument, so both paths read the forms the same way.
A bare number keeps skipping the item lookup: `ResolveString` reads "6948"
as an itemID, and a bare number that is not an equipment slot has to stay
a spellID per the documented `/cast 5019` rule.
An explicit itemID now also resolves when none is carried, falling back to
the ID after the bag and equipment walk misses. The icon and tooltip come
from the item record, and the tooltip path already handled an unheld item
through a hyperlink, so a macro naming an item in the bank or one written
before looting it now displays. Names are still limited to what you hold,
since 1.12 has no name-keyed item cache.
* fix(macro): make [@cursor] work in /cast, /use and #showtooltip
`/use [@cursor] item:4390` did nothing and its `#showtooltip` showed the
question mark. Two causes, both in the addon.
The parser rejected the clause. A group whose only piece is `@unit` passes
only while that unit exists, and the existence test ran UnitExists on
`cursor`, which is not a unit token. The engine raises there, the pcall
caught it, and the group failed. `none` was already exempt; `cursor` joins
it, since both name something other than a unit and neither can be tested
that way.
Nothing routed the target once it did pass. `SecureCmdUseItem` sent every
target through UseItemByName, which takes a unit GUID, and the spell branch
had only the on-unit and default cases. A `cursor` target now goes to
C_Item.UseAtCursor and C_Spell.CastAtCursor, which were written as the
`[@cursor]` analogs but had no caller. SecureCmdItemParse has already
turned a bag or inventory slot into a link, so one item call covers every
value form.
`#showtooltip` needed no change: the value resolves once the clause passes.
* feat(macro): accept a character name as a macro target
`/cast [target=Feral] Rejuvenation` did nothing. A `@unit` or `target=unit`
piece takes a character name as well as a unit token, but nothing here
turned a name into something the unit functions accept, and the existence
gate ran UnitExists on it, which raises for a string that names no token.
`UnitTokenFromName(name [, exactMatch])` runs the engine's own by-name
search — `FUN_UNIT_FIND_BY_NAME`, the one behind TargetByName, AssistByName
and FollowByName — and reports the winner as a token: a standard one when
it fits, else the GUID literal, which this client's resolver takes too. It
walks party, then raid, then every loaded unit, so it reaches units no
token names. Prefix match by default, nearest first, like TargetByName.
`GroupPasses` now resolves a named target once and uses it for both jobs:
the bare-group existence test (`[@Feral][] Spell` falls through when they
are not around) and the conditions, which previously raised on a name.
The pcall that already guarded the existence test is what tells a token
from a name, so a token target costs no more than before.
The slash handlers resolve the target the same way before handing it to
CastAtUnit, UseItemByName, FocusUnit or StartAttack, and drop the command
when a named unit is not around.
* feat(macro): drop a ground-target item at your feet with [@player]
`/use [@player] item:4390` sent the grenade through UseItemByName, which
passes a target GUID but never commits the placement, so the reticle came
up instead of the grenade landing. Route a `player` target to
`C_Item.UseAtUnit` instead, which commits at the unit's position.
Only your own position is offered. Aiming a ground-target item at another
unit is not something the game lets you do by hand, so the slash handler
does not either; every other unit target keeps going to UseItemByName.
`C_Item.UseAtUnit` now dispatches with the unit's GUID rather than a zero
target, matching `C_Spell.CastAtUnit`. Without that, routing `@player`
through it would have cost a non-ground item its target: a bandage or a
scroll would fire at the current selection instead of at you. It now
covers both kinds of on-use item, the way CastAtUnit covers both kinds of
spell.
* fix(macro): stop /cast [@unit] aiming ground spells at that unit
The same aim the item side was just denied: `/cast [@target] Flamestrike`
dropped the reticle on the target with no click, for any unit. Placing a
ground spell somewhere you could not put it by hand is aim the player has
not earned, and it should not differ between a spell and a grenade.
`/cast [@player]` and `/cast [@cursor]` still place, since both name a
position you can already aim at. Every other unit still has the spell cast
on it when it takes a unit target, which is what `@unit` is for; only the
ground-placement leg is dropped, leaving the reticle up exactly as casting
by hand does.
`C_Spell.CastAtUnit` keeps the whole primitive and gains a third argument
for the choice, defaulting to placing so the API and its callers are
unchanged. The restriction lives in the slash handler, the same split the
item side uses, where `C_Item.UseAtUnit` stays unrestricted and only
`/use` limits itself to `@player`.
`Spell::AtCursor::GroundPlacementPending` reports whether the in-flight
placement is a ground one, so the handler can leave that reticle up while
still cancelling a placement for a unit the engine did not accept. Leaving
that armed would strand the cursor.
* fix(item): stop a bad unit raising out of C_Item.UseItemByName
The optional `unit` went straight to the engine's token resolver, which
raises for a string that names no token. Both the code comment and the
API docs promised the opposite, that an unrecognized string is no target,
matching the no-op contract the item argument already has.
It is reachable without an addon calling the function directly: secure
button attributes and key bindings both feed it a configured string, so a
`unit="foo"` attribute raised inside a click handler.
Probe with Unit::TokenResolve::IsUnitToken first and treat anything else
as no target, which makes the documented contract true.
C_Item.UseAtUnit keeps raising, which is deliberate and now stated in its
docs: it is the companion of C_Spell.CastAtUnit, which documents the same
behavior as matching UnitHealth("garbage").
* feat(macro): let an addon publish its own macro display
`C_Macro.SetMacroDisplay(macroSlot, value)` hands a macro's resolution to
the display path, for an addon that parses macros itself. It is aimed at
SuperCleveRoidMacros, which today replaces ten action globals plus
GameTooltip.SetAction to put its answers on the bar, and borrows an
unrelated action slot to get a range check for a macro.
None of that is needed. Writing the spell into the engine's own per-macro
cache is what makes cooldown, range, usable, current and auto-repeat
correct for a macro button, with nothing overridden, and the icon then
reaches two places a Lua override cannot: the cursor while a macro is
dragged, and the macro window grid, both of which come from an engine
getter we hook.
The value takes the forms a `#showtooltip` value takes, so a publisher
hands over what it would have written in the macro. Three states: a value
to show, false for claimed-but-nothing-matched, nil to release.
Ownership is per macro. A published one is not parsed or re-evaluated by
us and is honored even while yielding; the rest stay ours. Nothing is
re-evaluated for the publisher, but a published resolution is re-applied
whenever the engine's re-parse overwrites the cache, so a macro edit
cannot silently replace it.
The wholesale stand-down when SuperCleveRoidMacros is loaded is lifted by
`CleveRoids.ClassicAPIMacroDisplay`, which a build sets to say it drives
us. Forks without it keep the all-or-nothing yield, so an older one cannot
end up fighting for the same buttons.
* fix(macro): accept the !Name prefix in /cast and #showtooltip
`#showtooltip` over `/cast !Shoot` showed nothing and the line cast
nothing: the `!` prefix, which asks for a toggle ability to be started
but never turned off, was never part of vanilla and no name resolver
knew it.
Split it in two.
The NAME is normalized in the one co-hook on the engine's single
name -> spellbook-slot resolver, which already owned the numeric
spellID form (so `spell/CastByID.cpp` becomes `spell/NameResolve.cpp`).
`FUN_RESOLVE_SPELL_NAME_TO_BOOK_ID` calls that resolver, so a single
strip covers the runtime cast, `Spell::Arg`, the `#showtooltip`
resolution and the engine's own macro parser -- which is what lets
`IsAutoRepeatAction` light a `/cast !Shoot` button even while macro
display is yielded to SuperCleveRoidMacros.
The BEHAVIOR stays in Lua: `SecureCmdCast` strips the prefix and casts
through the existing `CastSpellNoToggle`, which asks the engine whether
the ability is already up first. `CastSpellByName` cannot carry it --
re-registering that global is off limits and nampower already co-hooks
it.
`CastSpellNoToggle` gains the `placeGroundSpell` argument that
`C_Spell.CastAtUnit` has, so `/cast [@target] !X` keeps the rule that
only your own feet and the cursor place a ground-target spell. It also
tolerates a `!` on its own input now, since its auto-repeat name
compare is ours rather than the engine's.
* feat(item): take an item location wherever an item action takes an item
`C_Item.UseAtCursor`, `UseAtUnit`, `UseItemByName` and `EquipItemByName`
took an item reference only - an itemID, `item:N`, a link, or a name - and
resolved it by searching the bags for the first match. Holding two stacks of
the same item, or two copies enchanted differently, there was no way to say
which one you meant.
They now also take an item location: `{bagID=B, slotIndex=S}`,
`{equipmentSlotIndex=N}`, or an item GUID string - the shapes
`C_Item.GetItemID` already took. A location names one exact item.
`Item::Location::FindItemArgOrLocation` owns the overload; the old `Resolve`
(locations, pointer) and the new `ResolveItemArgOrLocation` (either, pointer)
are wrappers over it, so the classification and the walk live in one place.
None of the four call sites resolves anything itself any more.
A table is only ever a location, and so is a string that parses as a strict
`0x` + 16 hex digit GUID, which no item link or item name can look like. The
form is decided from the argument alone and committed to: a location resolve
STOMPS the Lua stack (`PackBagSlot` overwrites the first slots with its own
arguments), so falling back to the reference forms after one had run would
re-read the argument as whatever it left behind - a bag index read as an
itemID, which names an unrelated item.
`EquipItemByName` needs the source coordinates too, since the swap packet
carries them, which is what the detail form is for. An
`{equipmentSlotIndex=N}` location names a worn item, so with a `dstSlot` it
routes to `Item::Swap::FromPaperdoll` - that is how a ring 11<->12, trinket
13<->14 or weapon 16<->17 move is expressed. Without a `dstSlot` there is no
slot for the engine to pick, so that combination does nothing.
Its `lua_settop(L, 0)` ahead of `ClearCursor` is gone: `Script_ClearCursor`
(`0x004895B0`) is `FUN_00495190(1, 1)` and a return - no arguments, no stack
reads. Dropping it lets the item resolve run after the cursor clear, which a
location needs: while an item is held its slot reads empty, so the location
it came from would otherwise resolve to nothing.
* refactor: centralize the item constants and the icon-path build
Four copies of the ItemStats displayInfoID -> `Interface\Icons\<name>`
chain had accumulated - `item/GetData`, `item/Info`, `container/ItemInfo`
and the new `item/Icon` - and they had already drifted: two checked for an
empty icon name and two did not. `Item::Icon::PathForDisplayInfoID` is now
the one builder and the other three call it, so a change to that chain has
a single site. `PathForItemID` is it plus the cache lookup.
`action/ItemState` had local constants shadowing values already in
`Offsets.h`: `kItemSpellSlots` for `ITEMSTATS_SPELL_SLOT_COUNT`, and a bare
`trigger == 0` for `ITEM_SPELLTRIGGER_ON_USE`. `INVTYPE_AMMO` / `THROWN`
existed in two files, and the engine runner's `0x400` macro line buffer in
two more, so those move to `Offsets.h` as well - `INVTYPE_*` next to the
string table they index, `MACRO_LINE_BUFFER_SIZE` next to the delimiters.
CLAUDE.md's rule, and duplicated offsets drifting is exactly what it was
written for.
* fix(macro): indented directives, release, and icon-getter re-entry
Three defects found reviewing the `#showtooltip` work, plus dead code.
A directive typed with a leading space was lost AND leaked to chat.
`ParseDirective` and the two `#`-line filters all tested byte 0, but the
tokenizer splits on `\r\n` only, so ` #showtooltip` arrives with its space:
the parse missed it, and then `Macro::RunBody` / `Macro::Execute` failed to
recognize the comment and dispatched the line through `EXECUTE_CHAT_LINE` -
the /say this feature exists to stop. All three skip blanks now, as does
`CastCommandArgs` so an indented `/cast` line is still collected, and the
runner dispatches the trimmed line so an indented command works at all.
`C_Macro.SetMacroDisplay(slot, nil)` left the publisher's spell in place.
`Release` cleared our entry and asked for a rescan, but `Rescan` only marks
an entry dirty when it has a directive with options - so for a macro with
no directive of its own, nothing ever rewrote `+0x564`, and the button, its
tooltip, cooldown and auto-repeat state stayed on the published spell until
the engine happened to re-parse. It now hands the field back to the engine
by running the engine's own parser, then repaints.
The macro icon getter could run Lua from under a click. `FUN_MACRO_ICON_PATH`
has two callers and one is `FUN_MACRO_PICKUP`, inside the UseAction core, so
`Lookup`'s catch-up could evaluate conditions through `SecureCmdOptionParse`
and fire `ACTIONBAR_SLOT_CHANGED` into addon handlers while the drag was on
the stack - the re-entrancy hazard CLAUDE.md records for `Tooltip::SetEvents`.
`LookupPassive` reads only what the entries already hold; the world tick
does the work and repaints, so a resolution can be one tick behind an edit.
Also drop `Active()` (no callers) and `RunBody`'s unused trampoline, and
correct the header's reference to a module that does not exist: the icon
comes from `Macro::IconPath`, not `Action::Texture`.
* fix(slash): five conditional-command defects, and cheaper option passes
`/cast 5019` could consume an item. A bare number that is not an
equipment slot is a spellID, but it reached the item lookup, which reads a
number as an itemID - so carrying item 5019 used it instead of casting the
spell. `Macro::ShowTooltip::ResolveValue` already guarded this exact case,
so the button showed the spell while the click used an item.
Every bare `/targetenemy` stepped backwards. The cycling selectors pass
the parsed value as their reverse flag, and a clause that matches with no
value yields the empty string - which is a true boolean in Lua. Six
commands were affected in their most common form.
`/cast [@none] Spell` did nothing. `@none` names no unit, but only
`@cursor` was exempted from the token resolve, so `none` went to the
by-name search and the cast was dropped. It now means no unit, which is
the untargeted form of the verb; `/target [@none]` clears the target, as
documented. The other unit verbs no longer feed `none` to that search
either - it matches on the START of a name, so it would find a Nonek.
`/assist [@target] Bob` ignored Bob. `/target` and `/follow` both let a
trailing name win over an explicit `target=target`; assist did not.
`/use [@player] 0 1` used the wrong item. The position branches ran before
the bag branch, so a named slot was thrown away and the item re-found by
link - the first match anywhere, which with two stacks is the wrong one.
Every form now resolves to one item and goes through one call, which also
means a slot is aimed by `@unit` like a name is, and that `/use` always
uses: clicking a bag slot sells the item at a merchant and repairs it
under the repair cursor (`Script_UseContainerItem` branches on the
merchant GUID and on cursor mode 0x11), which a typed command must not do.
`GroupPasses` also stopped paying for an answer it discards. A group with
conditions only needs a token, so it asks `IsUnitToken` rather than
`pcall(UnitExists)` - the conditions test existence themselves. The
existence path keeps its single pcall, and a name, which costs an
object-manager search, is remembered for the rest of the pass.
ClassicAPI
ClassicAPI is a DLL for World of Warcraft 1.12.1 (Vanilla / Turtle WoW). It backports a large part of the modern WoW API — 550+ functions and 50+ events, plus much of Lua 5.1 — into the 1.12 client, so addons written for later versions (3.3.5+ or Classic Era) run with little or no change.
It hooks the engine after WoW boots and registers everything the same way WoW registers its own Lua functions. Nothing else to install — the DLL is self-contained.
Highlights
The headline features. Each one takes effect as soon as the DLL loads, so your existing addons benefit without any code changes. The complete per-function reference is in docs/API.md.
Lua 5.1 compatibility
The flagship feature: run modern Lua 5.1 addon code on 1.12's Lua 5.0 VM.
| Feature | Effect |
|---|---|
| Syntax | Compiles the Lua 5.1 length (#), modulo (%), ...-expression, 0x hex-literal, and leveled long bracket ([=[ ]=]) syntax that vanilla's Lua 5.0 rejects, by rewriting addon source before it compiles. Each addon file also receives its (name, table) through ... (local name, tbl = ...). |
| Upvalue limit | A function can use up to 60 upvalues, the outer locals it refers to, matching Lua 5.1. Lua 5.0 stops at 32 and rejects the whole file, so a large handler that reads many file-level locals can be valid 5.1 and still fail to load here. Nothing changes for a function within 32. |
| String methods | Every string value accepts method calls — ("asd"):upper(), ("%d gold"):format(n), msg:match("^!(%w+)") — resolving through the string table, the way Lua 5.1 works. Works on literals and variables, in-world and on the login screen, and inside coroutines. |
| Script-handler arguments | Frame-script handlers receive their values as positional arguments — OnMouseWheel(self, delta), OnClick(self, button), OnEvent(self, event, ...), etc. — so modern addon ports work unmodified. The this / arg1 globals stay set. A handler that declares no parameters is unaffected. A handler that declared a parameter and expected nil now receives its real value. On by default. SetModernScriptArgs(false) restores exact vanilla dispatch. |
Modern client behaviors
| Feature | Effect |
|---|---|
| Inline textures | Draws inline texture markup (|T…|t) and atlas markup (|A…|a) as icons in FontStrings, chat, and tooltips. This covers item and spell icons, raid-target markers, and the coin icons in money strings. GetStringWidth and GetStringHeight count the icons, so measured width and text wrapping stay correct. Done in pure C++ by hooking the engine's text pipeline — no addon. |
| Tooltip line cap | Lifts GameTooltip's hard 30-line limit to 60 for every GameTooltipTemplate frame (GameTooltip, ShoppingTooltip1/2, ItemRefTooltip, AtlasLoot, …). Stat-heavy tooltips and comparison blocks (e.g. pfUI's eqcompare) no longer have their extra lines silently dropped. Done in pure C++ by growing the engine's FontString pool at tooltip-creation time. |
| Event-driven nameplates | The modern C_NamePlate API, driven by real events. NAME_PLATE_UNIT_ADDED / NAME_PLATE_UNIT_REMOVED fire as plates appear and vanish, nameplate1..nameplateN tokens resolve with every UnitX function (and fire UNIT_HEALTH, UNIT_AURA, … as arg1 == "nameplateN"), and C_NamePlate.GetNamePlateForUnit / GetNamePlates hand back the live frames. |
| Focus target | A sticky focus unit. FocusUnit("target") pins it and ClearFocus() drops it, with PLAYER_FOCUS_CHANGED on every change. The focus / focustarget tokens resolve with every UnitX function and fire unit events (UNIT_HEALTH, UNIT_AURA, … as arg1 == "focus"), and the predefined FOCUSTARGET / TARGETFOCUS keybinds are ready to set. |
Retail-like /reload |
/reload picks up addon changes made while the game runs. A new folder under Interface\AddOns\ registers and loads as a normal addon, new files added to an existing addon's TOC load, a newly installed addon's first SavedVariables save survives /reload, ## metadata edits (## SavedVariables:, ## Dependencies:, ## Title:, …) take effect, and a deleted addon folder drops from the addon list. |
| Multi-flavor & conditional TOC | Loads modern multi-flavor addons that ship one folder. Selects a version-specific TOC (<Name>_ClassicAPI.toc or <Name>_Turtle.toc) and the matching keybinding file (Bindings_ClassicAPI.xml / Bindings_Turtle.xml), accepts a comma-separated ## Interface: version list (compatible when it includes the client version 11200), and honors per-line [AllowLoadGameType] / [AllowLoadTextLocale] conditions and [Family] / [Game] / [TextLocale] path variables inside a TOC. |
| Launch switches | Options you add to the shortcut that starts the game. -config <name> reads and writes WTF\<name> in place of WTF\Config.wtf, so one install can hold several settings profiles. -gluescript and -gluescriptFile run Lua at the login and character-select screens, every time those screens appear. -gamescript and -gamescriptFile run it one time, after you enter the world. Each script runs after the interface has loaded, so it can call interface functions and use frames. |
| Any texture size | Textures load at any size and any shape. Width and height do not need to be powers of two, and there is no fixed upper limit. The only limit is the maximum texture size of your graphics card. This applies to every texture path: SetTexture, sprite sheets, inline textures, tooltips, and masks. The client allocates memory for a large texture only when an addon loads one, so small textures cost nothing extra. |
Full API reference
Everything ClassicAPI adds, in full. Each section is collapsed — click a heading to expand it. For signatures and return values, see the per-function reference in docs/API.md.
In-game Lua calls — 550+ functions across ~60 namespaces
| Namespace | Calls |
|---|---|
| Action | GetActionInfo |
| AddOns | C_AddOns.DoesAddOnExist, C_AddOns.GetAddOnLocalTable, C_AddOns.GetAddOnName, C_AddOns.GetAddOnNotes, C_AddOns.GetAddOnOptionalDependencies, C_AddOns.GetAddOnSecurity, C_AddOns.GetAddOnTitle, C_AddOns.IsAddOnLoadable, C_AddOns.IsAddOnLoaded, C_AddOns.LoadAddOn |
| AuctionHouse | C_AuctionHouse.PostItem |
| Bindings | SetBindingSpell, SetBindingItem, SetBindingMacro, SetBindingClick, SetOverrideBinding, SetOverrideBindingSpell, SetOverrideBindingItem, SetOverrideBindingMacro, SetOverrideBindingClick, ClearOverrideBindings |
| Chat | GetCurrentChatGUID |
| ChatBubbles | C_ChatBubbles.GetAllChatBubbles |
| Class | FillLocalizedClassList |
| ColorUtil | C_ColorUtil.ConvertRGBToHSV, C_ColorUtil.ConvertHSVToRGB, C_ColorUtil.ConvertHSVToHSL, C_ColorUtil.ConvertHSLToHSV, C_ColorUtil.ConvertHSLToRGB, C_ColorUtil.GenerateTextColorCode, C_ColorUtil.WrapTextInColor, C_ColorUtil.WrapTextInColorCode |
| Combat | InCombatLockdown, StartAttack, StopAttack |
| Console | CalculateStringEditDistance, ConsoleEcho, ConsoleExec, ConsoleGetAllCommands, ConsoleGetColorFromType, ConsoleGetFontHeight, ConsoleIsActive, ConsolePrintAllMatchingCommands, SetConsoleKey |
| CVar | C_CVar.AreCVarsLoaded, C_CVar.DoesCVarExist, C_CVar.GetCVarBitfield, C_CVar.GetCVarBool, C_CVar.GetCVarInfo, C_CVar.SetCVarBitfield |
| Cursor | GetCursorInfo |
| Container | C_Container.AutoStoreItem, C_Container.CalculateTotalNumberOfFreeBagSlots, C_Container.GetContainerItemCharges, C_Container.GetContainerItemDurability, C_Container.GetContainerItemID, C_Container.GetContainerItemInfo, C_Container.GetContainerItemEquipmentSetInfo, C_Container.GetContainerItemQuestInfo, C_Container.GetContainerItemRepairCost, C_Container.GetContainerFreeSlots, C_Container.GetContainerNumFreeSlots, C_Container.GetBackpackAutosortDisabled, C_Container.GetBankAutosortDisabled, C_Container.GetItemCooldown, C_Container.GetSortBagsRightToLeft, C_Container.HasContainerItem, C_Container.IsContainerItemOpenable, C_Container.MoveItem, C_Container.PlayerHasHearthstone, C_Container.SetBackpackAutosortDisabled, C_Container.SetBankAutosortDisabled, C_Container.SetSortBagsRightToLeft, C_Container.SortBags, C_Container.SortBankBags, C_Container.SwapItems, C_Container.UseHearthstone, GetItemCooldown |
| Creature | C_CreatureInfo.GetCreatureID, C_CreatureInfo.GetCreatureInfoByID, C_CreatureInfo.RequestLoadCreatureByID, C_CreatureInfo.GetRaceInfo, C_CreatureInfo.GetClassInfo, C_CreatureInfo.GetCreatureFamilyInfo, C_CreatureInfo.GetCreatureFamilyIDs, C_CreatureInfo.GetFactionInfo, C_CreatureInfo.GetCreatureTypeInfo, C_CreatureInfo.GetCreatureTypeIDs |
| Currency | GetCoinTextureString, C_CurrencyInfo.GetCoinTextureString |
| EncodingUtil | C_EncodingUtil.CompressString, C_EncodingUtil.DecompressString, C_EncodingUtil.EncodeBase64, C_EncodingUtil.DecodeBase64, C_EncodingUtil.EncodeHex, C_EncodingUtil.DecodeHex, C_EncodingUtil.SerializeJSON, C_EncodingUtil.DeserializeJSON, C_EncodingUtil.SerializeCBOR, C_EncodingUtil.DeserializeCBOR |
| EquipmentSet | C_EquipmentSet.CanUseEquipmentSets, C_EquipmentSet.ClearIgnoredSlotsForSave, C_EquipmentSet.CreateEquipmentSet, C_EquipmentSet.DeleteEquipmentSet, C_EquipmentSet.EquipmentSetContainsLockedItems, C_EquipmentSet.GetEquipmentSetID, C_EquipmentSet.GetEquipmentSetIDs, C_EquipmentSet.GetEquipmentSetInfo, C_EquipmentSet.GetIgnoredSlots, C_EquipmentSet.GetItemIDs, C_EquipmentSet.GetItemLocations, C_EquipmentSet.GetNumEquipmentSets, C_EquipmentSet.IgnoreSlotForSave, C_EquipmentSet.IsSlotIgnoredForSave, C_EquipmentSet.ModifyEquipmentSet, C_EquipmentSet.SaveEquipmentSet, C_EquipmentSet.UnignoreSlotForSave, C_EquipmentSet.UseEquipmentSet |
| Events | C_EventUtils.IsEventValid, GetFramesRegisteredForEvent |
| Expansion | ClassicExpansionAtLeast, ClassicExpansionAtMost, GetClassicExpansionLevel |
| Faction | C_Reputation.GetFactionDataByID, C_Reputation.GetFactionDataByIndex, C_Reputation.GetFactionStandings, C_Reputation.GetLastStandingChange, C_Reputation.GetWatchedFactionData, C_Reputation.IsFactionActive, C_Reputation.IsFactionActiveByID, C_Reputation.IsFactionInactive, C_Reputation.SetFactionActive, C_Reputation.SetFactionActiveByID, C_Reputation.SetFactionInactive, C_Reputation.SetFactionInactiveByID, C_Reputation.SetSelectedFaction, C_Reputation.SetSelectedFactionByID, C_Reputation.SetWatchedFactionByID, C_Reputation.ToggleFactionAtWar, C_Reputation.ToggleFactionAtWarByID, GetFactionIDByIndex, GetFactionInfoByID, GetFactionParentID |
| Focus | ClearFocus, FocusUnit |
| Frame | region:SetPoint("point") (one-arg form), region:SetSize, region:GetSize, region:IsMouseOver, region:GetRect, region:IsDragging, GetMouseFoci, frame:SetShown, fontstring:GetStringHeight, fontstring:GetUnboundedStringWidth, fontstring:GetWrappedWidth, fontstring:GetNumLines, fontstring:GetLineHeight, fontstring:IsTruncated, fontstring:SetMaxLines, fontstring:GetMaxLines, fontstring:SetFormattedText, texture:SetRotation, texture:GetRotation, texture:SetVertexOffset, texture:GetVertexOffset, texture:SetColorTexture, texture:SetAtlas, texture:GetAtlas, texture:ResetTexCoord, texture:SetSpriteSheetCell, texture:SetDesaturation, texture:GetDesaturation, texture:SetMask, frame:CreateMaskTexture, texture:AddMaskTexture, texture:RemoveMaskTexture, texture:GetNumMaskTextures, texture:GetMaskTexture, fontstring:SetRotation, fontstring:GetRotation, editBox:SetCursorPosition, editBox:GetCursorPosition, editBox:GetUTF8CursorPosition, editBox:ClearHighlightText, editBox:HasFocus, editBox:HasText, editBox:SetHighlightColor, editBox:GetHighlightColor, editBox:ClearHistory, frame:SetResizeBounds, frame:HookScript, frame:IsEventRegistered, frame:RegisterUnitEvent, frame:GetEffectiveAlpha, frame:SetAttribute, frame:SetAttributeNoHandler, frame:ClearAttribute, frame:GetAttribute, OnAttributeChanged (script), SetModernScriptArgs, GetModernScriptArgs, PreClick (script), PostClick (script), GetClickFrame |
| FriendList | C_FriendList.GetFriendInfo, C_FriendList.GetFriendInfoByIndex, C_FriendList.GetNumFriends, C_FriendList.GetNumOnlineFriends, C_FriendList.GetNumWhoResults, C_FriendList.GetWhoInfo, C_FriendList.IsFriend, C_FriendList.IsIgnored, C_FriendList.IsIgnoredByGuid, C_FriendList.IsWhoQueryPending, C_FriendList.SendWhoQueryByName, C_FriendList.SetFriendNotes, C_FriendList.SetFriendNotesByIndex |
| GameObject | C_GameObjectInfo.GetGameObjectInfoByID, C_GameObjectInfo.RequestLoadGameObjectByID, ClosestGameObjectPosition |
| Glue | C_Glue.IsOnGlueScreen |
| Gossip | C_GossipInfo.CloseGossip, C_GossipInfo.GetActiveQuests, C_GossipInfo.GetAvailableQuests, C_GossipInfo.GetNumActiveQuests, C_GossipInfo.GetNumAvailableQuests, C_GossipInfo.GetNumOptions, C_GossipInfo.GetOptions, C_GossipInfo.GetText, C_GossipInfo.SelectActiveQuest, C_GossipInfo.SelectAvailableQuest, C_GossipInfo.SelectOption, C_GossipInfo.SelectOptionByIndex |
| GameTooltip | GameTooltip:AddSpellByID, GameTooltip:GetGameObject, GameTooltip:GetItem, GameTooltip:GetOwner, GameTooltip:GetSpell, GameTooltip:GetUnitGUID, GameTooltip:HasGameObject, GameTooltip:HasItem, GameTooltip:HasSpell, GameTooltip:HasUnit, GameTooltip:IsEquippedItem, GameTooltip:SetEquipmentSet, GameTooltip:SetHyperlinkCompareItem, GameTooltip:SetInventoryItemByID, GameTooltip:SetItemByGUID, GameTooltip:SetItemByID, GameTooltip:SetSpellByID, GameTooltip:SetTalentByID, GameTooltip:SetTotem, GameTooltip:SetUnitAura, OnTooltipSetItem, OnTooltipSetSpell, OnTooltipSetUnit, OnTooltipSetGameObject (scripts) |
| Hooks | hooksecurefunc |
| Input | GetMouseButtonClicked, IsLeftAltKeyDown, IsLeftControlKeyDown, IsLeftShiftKeyDown, IsModifierKeyDown, IsMouseButtonDown, IsRightAltKeyDown, IsRightControlKeyDown, IsRightShiftKeyDown |
| Instance | GetInstanceInfo |
| Item | C_Item.DoesItemExist, C_Item.DoesItemExistByID, C_Item.EquipItemByName, C_Item.GetCurrentItemLevel, C_Item.GetDetailedItemLevelInfo, C_Item.GetEnchantInfo, C_Item.GetItemCount, C_Item.GetItemFamily, C_Item.GetItemGUID, C_Item.GetItemIcon, C_Item.GetItemIconByID, C_Item.GetItemID, C_Item.GetItemInfo, C_Item.GetItemInfoInstant, C_Item.GetItemInventorySlotInfo, C_Item.GetItemInventorySlotKey, C_Item.GetItemInventoryType, C_Item.GetItemInventoryTypeByID, C_Item.GetItemLink, C_Item.GetItemLocation, C_Item.GetItemMaxStackSize, C_Item.GetItemMaxStackSizeByID, C_Item.GetItemName, C_Item.GetItemNameByID, C_Item.GetItemQuality, C_Item.GetItemQualityByID, C_Item.GetItemSellPrice, C_Item.GetItemSellPriceByID, C_Item.GetItemSetID, C_Item.GetItemSetIDByID, C_Item.GetItemSetInfo, C_Item.GetItemSpell, C_Item.GetItemStatDelta, C_Item.GetItemStats, C_Item.GetItemClassInfo, C_Item.GetItemSubClassInfo, C_Item.GetItemTempEnchantInfo, C_Item.GetItemUniqueness, C_Item.GetItemUniquenessByID, C_Item.GetStackCount, C_Item.GetWeaponEnchantInfo, C_Item.IsBound, C_Item.IsConsumableItem, C_Item.IsEquippableItem, C_Item.IsEquippedItem, C_Item.IsItemDataCached, C_Item.IsItemDataCachedByID, C_Item.IsItemGUIDInInventory, C_Item.IsItemInRange, C_Item.IsItemOpenable, C_Item.IsLocked, C_Item.LockItem, C_Item.LockItemByGUID, C_Item.PickupItem, C_Item.UnlockAllItems, C_Item.UnlockItem, C_Item.RequestLoadItemData, C_Item.RequestLoadItemDataByID, C_Item.UseAtCursor, C_Item.UseAtUnit, C_Item.UseItemByName, GetAuctionItemID, GetAuctionSellItemID, GetAverageItemLevel, GetCraftReagentItemID, GetInboxItemID, GetInventoryItemDurability, GetInventoryItemID, GetInventoryItemsForSlot, GetInventoryItemRepairCost, GetItemClassInfo, GetItemIcon, GetItemSubClassInfo, GetLootRollItemID, GetLootSlotItemID, GetMerchantItemID, GetQuestItemID, GetQuestLogItemID, GetTradePlayerItemID, GetTradeSkillItemID, GetTradeSkillReagentItemID, GetTradeTargetItemID, OffhandHasWeapon |
| Loot | C_Loot.GetNearbyLootableUnits, C_Loot.GetLastScanResults, C_Loot.IsScanInProgress, C_Loot.LootAllCorpses, C_Loot.LootUnit, C_Loot.LootUnitItem, C_Loot.ScanNearbyLoot |
| LootHistory | C_LootHistory.GetNumItems, C_LootHistory.GetItem, C_LootHistory.GetPlayerInfo, C_LootHistory.Clear |
| LossOfControl | C_LossOfControl.GetActiveLossOfControlData, C_LossOfControl.GetActiveLossOfControlDataCount |
| Lua | collectgarbage (5.1 options), coroutine.create, coroutine.resume, coroutine.running, coroutine.status, coroutine.wrap, coroutine.yield, CreateFromMixins, math.fmod, math.huge, math.modf, Mixin, select, string.gmatch, string.gsub (table replacement), string.match, string.reverse, strjoin, strreplace, strrev, strsplit, strtrim, table.count, table.maxn, table.wipe, unpack (range args), xpcall (argument forwarding) |
| Macros | C_Macro.CreateMacro, C_Macro.EditMacro, GetLooseMacroIcons, GetLooseMacroItemIcons, GetMacroIcons, GetMacroItemIcons, GetMacroSpell |
GetInboxItemLink, GetSendMailItemLink |
|
| Map | C_Map.CanSetUserWaypointOnMap, C_Map.ClearUserWaypoint, C_Map.GetAreaInfo, C_Map.GetAreas, C_Map.GetAreaTriggerInfo, C_Map.GetAreaTriggers, C_Map.GetBestMapForUnit, C_Map.GetFallbackWorldMapID, C_Map.GetMapAreaIDs, C_Map.GetMapArtLayers, C_Map.GetMapArtLayerTextures, C_Map.GetMapChildrenInfo, C_Map.GetMapInfo, C_Map.GetMapInfoAtPosition, C_Map.GetMapOverlays, C_Map.GetMapPosFromWorldPos, C_Map.GetMapRectOnMap, C_Map.GetMapWorldSize, C_Map.GetPlayerMapPosition, C_Map.GetUserWaypoint, C_Map.GetUserWaypointFromHyperlink, C_Map.GetUserWaypointHyperlink, C_Map.GetUserWaypointPositionForMap, C_Map.GetWorldPosFromMapPos, C_Map.HasUserWaypoint, C_Map.MapHasArt, C_Map.SetUserWaypoint |
| MapExplorationInfo | C_MapExplorationInfo.GetExploredMapTextures, C_MapExplorationInfo.GetUnexploredMapTextures |
| MerchantFrame | C_MerchantFrame.GetBuybackItemID, C_MerchantFrame.GetItemInfo, C_MerchantFrame.GetNumJunkItems, C_MerchantFrame.IsMerchantItemRefundable, C_MerchantFrame.IsSellAllJunkEnabled, C_MerchantFrame.SellAllJunkItems |
| NamePlate | C_NamePlate.GetNamePlateForGUID, C_NamePlate.GetNamePlateForUnit, C_NamePlate.GetNamePlateGUIDs, C_NamePlate.GetNamePlates |
| NameCache | C_PlayerCache.GetPlayerInfoByName, C_PlayerCache.IsEnabled, C_PlayerCache.IsScanEnabled, C_PlayerCache.RememberPlayer, C_PlayerCache.SetEnabled, C_PlayerCache.SetScanEnabled, GetPlayerInfoByGUID, UnitNameFromGUID |
| NewItems | C_NewItems.ClearAll, C_NewItems.IsNewItem, C_NewItems.RemoveNewItem |
| PlayerInfo | C_PlayerInfo.CanUseItem, C_PlayerInfo.GetClass, C_PlayerInfo.GetName, C_PlayerInfo.GetRace, C_PlayerInfo.GetSex, C_PlayerInfo.GUIDIsCreature, C_PlayerInfo.GUIDIsGameObject, C_PlayerInfo.GUIDIsPet, C_PlayerInfo.GUIDIsPlayer, C_PlayerInfo.IsConnected |
| Quest | C_QuestLog.GetNumQuestObjectives, C_QuestLog.GetQuestDetails, C_QuestLog.GetHeaderIndexForQuest, C_QuestLog.GetLogIndexForQuestID, C_QuestLog.GetQuestIDForLogIndex, C_QuestLog.GetTitleForQuestID, C_QuestLog.IsOnQuest, C_QuestLog.IsQuestDataCachedByID, C_QuestLog.IsUnitOnQuest, C_QuestLog.RequestLoadQuestByID, GetQuestLogLeaderBoardID |
| Spell | C_Spell.CancelSpellByID, C_Spell.CastAtCursor, C_Spell.CastAtUnit, C_Spell.CastingInfo, C_Spell.ChannelInfo, C_Spell.DoesSpellExist, C_Spell.GetSchoolString, C_Spell.GetSpellCastCount, C_Spell.GetSpellCooldown, C_Spell.GetSpellDescription, C_Spell.GetSpellDispelType, C_Spell.GetSpellEffectInfo, C_Spell.GetSpellEffectMechanics, C_Spell.GetSpellInfo, C_Spell.GetSpellLevelInfo, C_Spell.GetSpellLink, C_Spell.GetSpellLossOfControlCooldown, C_Spell.GetSpellMechanicByID, C_Spell.GetSpellName, C_Spell.GetSpellPowerCost, C_Spell.GetSpellRadius, C_Spell.GetSpellReagents, C_Spell.GetSpellRequiredTargetLevel, C_Spell.GetSpellSubtext, C_Spell.GetSpellTexture, C_Spell.IsAutoAttackSpell, C_Spell.IsCurrentSpell, C_Spell.IsNextMeleeSpell, C_Spell.IsRangedAutoAttackSpell, C_Spell.IsSelfBuff, C_Spell.IsSpellHarmful, C_Spell.IsSpellHelpful, C_Spell.IsSpellInRange, C_Spell.IsSpellPassive, C_Spell.IsSpellUsable, C_Spell.ResetsMeleeSwing, C_Spell.SpellHasRange, C_Spell.UnitCastingInfo, C_Spell.UnitChannelInfo, CanDualWield, CancelSpellByName, CastSpellNoToggle, GetCraftSpellID, GetSpellBonusDamage, GetSpellBonusHealing, GetSpellInfo, GetSpellLink, GetSpellRadius, GetSpellRequiredTargetLevel, GetSpellSchool, IsHarmfulSpell, IsHelpfulSpell, IsPassiveSpell, IsPlayerSpell, IsSpellKnown, IsUsableSpell, SpellHasRange |
| SpellBook | C_SpellBook.ContainsAnyDisenchantSpell, C_SpellBook.GetCurrentLevelSpells, C_SpellBook.GetNumSpellBookSkillLines, C_SpellBook.GetPlayerSpellsByAura, C_SpellBook.GetSkillLineIndexByID, C_SpellBook.GetSkillLineName, C_SpellBook.GetSkillLineRank, C_SpellBook.GetSpellBookItemCastCount, C_SpellBook.GetSpellBookItemInfo, C_SpellBook.GetSpellBookItemLossOfControlCooldownDuration, C_SpellBook.GetSpellBookItemLossOfControlCooldownInfo, C_SpellBook.GetSpellBookItemSkillLineIndex, C_SpellBook.GetSpellBookSkillLineInfo, C_SpellBook.GetSpellLevelLearned, C_SpellBook.GetSpellSkillLine, C_SpellBook.IsAutoAttackSpellBookItem, C_SpellBook.IsClassTalentSpellBookItem, C_SpellBook.IsRangedAutoAttackSpellBookItem, FindSpellBookSlotByID |
| State | CancelShapeshiftForm, Dismount, GetMirrorTimerInfo, GetMirrorTimerProgress, GetShapeshiftFormID, GetSheathState, IsAssistingRitual, IsFalling, IsIndoors, IsInGroup, IsInRaid, IsLoggedIn, IsMounted, IsOutdoors, IsStealthed, IsSwimming |
| System | CopyToClipboard, GetPhysicalScreenSize |
| Talent | GetTalentIDByIndex, GetTalentSpellID |
| Targeting | GetPlayerFacing, TargetDirectionEnemy, TargetDirectionFriend, TargetNearest, TargetNearestEnemyPlayer, TargetNearestFriendPlayer |
| TaxiMap | C_TaxiMap.GetTaxiNodesForMap, C_TaxiMap.GetAllTaxiNodes, C_TaxiMap.GetTaxiPaths, C_TaxiMap.GetTaxiPathWaypoints, C_TaxiMap.GetTaxiRoute |
| Texture | C_Texture.GetAtlasElementID, C_Texture.GetAtlasElements, C_Texture.GetAtlasExists, C_Texture.GetAtlasID, C_Texture.GetAtlasInfo, C_Texture.RegisterAtlas |
| Time | C_DateAndTime.AdjustTimeByDays, C_DateAndTime.AdjustTimeByMinutes, C_DateAndTime.CompareCalendarTime, C_DateAndTime.GetCalendarTimeFromEpoch, C_DateAndTime.GetCurrentCalendarTime, C_DateAndTime.GetSecondsUntilDailyReset, C_DateAndTime.GetServerTimeLocal, C_Timer.After, C_Timer.NewTicker, C_Timer.NewTimer, GetServerTime, GetTimeCached |
| Totem | GetTotemInfo, GetTotemTimeLeft, GetTotemDuration, TargetTotem |
| Tracking | GetNumTrackingTypes, GetTrackingInfo, SetTracking |
| TradeSkillUI | C_TradeSkillUI.GetTradeSkillListLink, C_TradeSkillUI.GetCraftListLink, C_TradeSkillUI.GetTradeSkillListRecipes |
| UIColor | C_UIColor.GetColors |
| Unit | ClosestUnitPosition, GetUnitSpeed, UnitClassBase, UnitCreatedBySpell, UnitCreatureFamilyID, UnitCreatureID, UnitCreatureTypeID, UnitDistanceSquared, UnitGUID, UnitHealthMissing, UnitInLineOfSight, UnitInRange, UnitIsAFK, UnitIsDND, UnitIsFeignDeath, UnitIsInMyGuild, UnitIsMinion, UnitIsOtherPlayersPet, UnitIsPet, UnitIsPossessed, UnitOwnerGUID, UnitPosition, UnitPower, UnitPowerMax, UnitPowerMissing, UnitPowerType, UnitRaceBase, UnitSpellHaste, UnitSpellTargetName, UnitStandState, UnitSubName, UnitTokenFromGUID |
| UnitAuras | C_UnitAuras.GetAuraDataByIndex, C_UnitAuras.GetAuraDataBySlot, C_UnitAuras.GetAuraDataBySpellName, C_UnitAuras.GetAuraDispelTypeColor, C_UnitAuras.GetAuraSlots, C_UnitAuras.GetBuffDataByIndex, C_UnitAuras.GetDebuffDataByIndex, C_UnitAuras.GetPlayerAuraBySpellID, C_UnitAuras.GetUnitAuraBySpellID, C_UnitAuras.GetUnitAuras, C_UnitAuras.RegisterAuraDurationModifierByTrigger, C_UnitAuras.RegisterComboDuration, C_UnitAuras.UnitAura, C_UnitAuras.UnitAuraBySlot, C_UnitAuras.UnitBuff, C_UnitAuras.UnitDebuff |
| VoiceChat | C_VoiceChat.GetTtsVoices, C_VoiceChat.GetRemoteTtsVoices, C_VoiceChat.SpeakText, C_VoiceChat.StopSpeakingText, C_TTSSettings.GetSpeechRate, C_TTSSettings.GetSpeechVolume, C_TTSSettings.GetSpeechVoiceID, C_TTSSettings.GetVoiceOptionName, C_TTSSettings.SetSpeechRate, C_TTSSettings.SetSpeechVolume, C_TTSSettings.SetVoiceOption, C_TTSSettings.SetVoiceOptionByName, C_TTSSettings.SetDefaultSettings, C_TTSSettings.RefreshVoices |
| XMLUtil | C_XMLUtil.DoesTemplateExist, C_XMLUtil.GetTemplateInfo, C_XMLUtil.GetTemplates |
GlueXML calls — login / realm-select / character-select screens
Registered on the glue Lua state (the engine that runs the login, realm-select, and character-select screens). The persistence entries in the first row are glue-only — they exist to support GlueXML patches that need a small persistence surface across sessions. The rest of the table is in-game calls that we also mirror onto the glue state because GlueXML had no way to reach them otherwise.
| Group | Calls |
|---|---|
| Account | SaveAccount, DeleteAccount, GetSavedAccounts, LoginWithSavedAccount (passwords encrypted in Windows Credential Manager, scoped per realmlist; plaintext never returned to Lua) |
| CharacterList | GetSavedCharacterOrder, SetSavedCharacterOrder (persist to WTF\Account\...\ClassicAPI.txt) |
| CVar | GetCVar, SetCVar, RegisterCVar, GetCVarDefault, C_CVar.GetCVarBool (storage is process-global — writes from glue are visible in-world and vice versa) |
| Glue | C_Glue.IsFirstLoadThisSession, C_Glue.IsOnGlueScreen |
| Script | RunScript (compile and run a Lua chunk in the glue state's globals — useful for slash-command-style helpers in GlueXML) |
| State | IsLoggedIn |
Macros — engine-level parsing extensions
Engine-level extensions to macro parsing and dispatch — no new Lua functions. See the Macros section in the Lua reference for details.
| Form | What it does |
|---|---|
/cast <spellID> |
/cast 5019 casts Shoot if known; macro slot tags correctly for action-bar UI |
CastSpellByName("<spellID>") |
Same — numeric strings resolve through the engine's name resolver |
CastSpellNoToggle("<name>") in a macro |
Engine's macro parser now recognizes it as a primary-spell line, so the macro slot in an addon like pfUI highlights when its spell is auto-repeating or its self-aura is active |
Console commands — developer console (-console)
Registered on the engine's developer console (the ~ console available
when launching with -console), not as Lua functions. See the
Console section in the Lua reference for details.
| Command | What it does |
|---|---|
ExportInterfaceFiles code |
Extracts Blizzard's UI source (.lua/.xml/.toc/.xsd) from the MPQs to BlizzardInterfaceCode\ |
ExportInterfaceFiles art |
Extracts Blizzard's UI art (.blp/.tga) from the MPQs to BlizzardInterfaceArt\ |
ExportDBCFiles |
Extracts the client's .dbc tables from the MPQs to DBFilesClient\ |
Events — new events fired to addons
| Event | Payload |
|---|---|
BAG_NEW_ITEMS_UPDATED |
(none) |
BAG_UPDATE_DELAYED |
(none) |
CURSOR_CHANGED |
isDefault, newCursorType, oldCursorType, oldCursorVirtualID |
EQUIPMENT_SETS_CHANGED |
(none) |
EQUIPMENT_SWAP_PENDING |
setID |
EQUIPMENT_SWAP_FINISHED |
success, setID |
FACTION_STANDING_CHANGED |
factionID, newStanding, repGained |
GLOBAL_MOUSE_DOWN |
button |
GLOBAL_MOUSE_UP |
button |
HEARTHSTONE_BOUND |
(none) |
ITEM_DATA_LOAD_RESULT |
itemID, success |
LEARNED_SPELL_IN_SKILL_LINE |
spellID, skillLineIndex, isGuildPerkSpell |
LOOT_HISTORY_ROLL_CHANGED |
itemIndex, playerIndex |
LOOT_HISTORY_ROLL_COMPLETE |
itemIndex |
LOOT_SCAN_COMPLETED |
(none) |
LOSS_OF_CONTROL_ADDED |
eventIndex |
LOSS_OF_CONTROL_UPDATE |
unitToken (always "player") |
MODIFIER_STATE_CHANGED |
keyName, down |
NAME_PLATE_CREATED |
nameplateFrame |
NAME_PLATE_UNIT_ADDED |
unitToken ("nameplateN") |
NAME_PLATE_UNIT_REMOVED |
unitToken ("nameplateN") |
PLAYER_EQUIPMENT_CHANGED |
equipmentSlot, hasCurrent |
PLAYER_FOCUS_CHANGED |
(none) |
PLAYER_STARTED_LOOKING |
(none) |
PLAYER_STOPPED_LOOKING |
(none) |
PLAYER_STARTED_MOVING |
(none) |
PLAYER_STOPPED_MOVING |
(none) |
PLAYER_STARTED_TURNING |
(none) |
PLAYER_STOPPED_TURNING |
(none) |
PLAYER_TOTEM_UPDATE |
totemSlot |
QUEST_ACCEPTED |
questLogIndex, questID |
QUEST_DATA_LOAD_RESULT |
questID, success |
QUEST_REMOVED |
questID |
QUEST_TURNED_IN |
questID, xpReward, moneyReward |
UNIT_SPELLCAST_SENT |
"player", target, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_START |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_STOP |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_DELAYED |
"player", castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_SUCCEEDED |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_INTERRUPTED |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_FAILED |
"player", castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_FAILED_QUIET |
"player", castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_CHANNEL_START |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_CHANNEL_UPDATE |
"player", castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_CHANNEL_STOP |
unit, castGUID, spellID, spellName, rank |
UNIT_SPELLCAST_RETICLE_TARGET |
"player", "", spellID, spellName, rank |
UNIT_SPELLCAST_RETICLE_CLEAR |
"player", "", spellID, spellName, rank |
UPDATE_INVENTORY_DURABILITY |
(none) |
UPDATE_SHAPESHIFT_FORM |
(none) |
USER_WAYPOINT_UPDATED |
(none) |
VOICE_CHAT_TTS_PLAYBACK_STARTED |
numConsumers, utteranceID, durationMS, destination |
VOICE_CHAT_TTS_PLAYBACK_FINISHED |
numConsumers, utteranceID, destination |
VOICE_CHAT_TTS_PLAYBACK_FAILED |
status, utteranceID, destination |
VOICE_CHAT_TTS_VOICES_UPDATE |
(none) |
Globals & enums
| Group | Constants |
|---|---|
| Version | CLASSIC_API_VERSION, INTERFACE_VERSION |
| Expansion | LE_EXPANSION_LEVEL_CURRENT, LE_EXPANSION_CLASSIC … LE_EXPANSION_MIDNIGHT |
| Item quality | LE_ITEM_QUALITY_POOR … LE_ITEM_QUALITY_WOWTOKEN |
| Unit stat | LE_UNIT_STAT_STRENGTH … LE_UNIT_STAT_SPIRIT |
| Addon security | Enum.AddOnSecurityStatus.{Secure,Insecure,Banned,NotAvailable} |
| Power type | Enum.PowerType.{HealthCost,None,Mana,Rage,Focus,Energy,Happiness} |
| Inventory type | Enum.InventoryType.Index*Type (0–34, e.g. IndexHeadType=1 … IndexRelicType=28) |
| Item class | Enum.ItemClass.{Consumable,Container,Weapon,Gem,Armor,Reagent,Projectile,Tradegoods,ItemEnhancement,Recipe,Quiver,Questitem,Key,Miscellaneous,…} (0–19) |
| Item quality | Enum.ItemQuality.{Poor,Common,Uncommon,Rare,Epic,Legendary,Artifact} (0–6) |
| Cursor type | Enum.UICursorType.{Default,Item,Money,Spell,PetAction,Merchant,Macro,Pet,…} (0–20; this client yields 0–5, 7 and 9) |
| Spellbook bank | Enum.SpellBookSpellBank.{Player,Pet} (0–1) |
| Spellbook item type | Enum.SpellBookItemType.{None,Spell,FutureSpell,PetAction,Flyout} (0–4; 1.12 only yields Spell/PetAction) |
Unit tokens — nameplateN, focus, markN
| Token | Resolves to |
|---|---|
nameplate1..nameplateN |
Unit behind the Nth visible nameplate, in creation-order. Works with every UnitX function — UnitName, UnitGUID, UnitClass, UnitHealth, etc. Suffix chains (nameplate1target, nameplate1targettarget) compose. See NamePlate / Unit tokens. |
focus / focustarget |
Sticky target set via FocusUnit, cleared via ClearFocus. Same UnitX coverage as nameplateN. Fires PLAYER_FOCUS_CHANGED on transition. See Focus. |
mark1..mark8 |
Unit currently wearing the Nth raid-target marker (mark1 = star … mark8 = skull). Same UnitX coverage as nameplateN, and fires unit events (UNIT_HEALTH, UNIT_AURA, …) with arg1 == "markN". UnitExists("markN") is false when the marker is unset, out of range, or on a non-unit. Suffix chains (mark1target) compose. See Unit tokens (markN). |
Bindings — direct-action and override binding families
ClassicAPI backports the direct-action and temporary override
binding families. Permanent bindings use the standard SPELL, ITEM,
MACRO, and CLICK command strings and can be saved normally. Overrides are
session-only, frame-owned, and support the usual priority flag.
See the Bindings API reference for signatures, precedence, execution behavior, macro-text usage, and 1.12 compatibility notes.
Predefined focus bindings. Injected into the engine's Targeting Functions group at FrameXML Bindings.xml load time, so they appear in the keybind UI alongside native targeting bindings instead of orphaned at the bottom.
| Binding | Action |
|---|---|
FOCUSTARGET |
FocusUnit("target") — pin current target as focus |
TARGETFOCUS |
TargetUnit("focus") — switch target to the focus |
See Predefined focus bindings for the implementation note.
Installation
Download the prebuilt ClassicAPI.dll from the
latest release
(or build it yourself). It's loaded with
VanillaFixes:
- Install VanillaFixes if it isn't already.
- Copy
ClassicAPI.dllinto your game directory. - Add
ClassicAPI.dlltodlls.txt. - Launch the game with
VanillaFixes.exe.
The bundled !!!ClassicAPI addon ships inside the DLL — no separate
addon download or install step needed.
Bundled addon: !!!ClassicAPI
The Lua-side companion library lives in
AddOns/!!!ClassicAPI/. It's a 1.12.1 /
Lua 5.0 backport of the modern Blizzard helpers that aren't engine
functions but that consumer code still expects to find as globals —
CallbackRegistryMixin, EventRegistry, ColorMixin + CreateColor,
Item / ItemLocation, MathUtil(Lerp / Clamp / CreateCounter),
TableUtil (tCompare, MergeTable, SafePack, etc.), and EventUtil
(ContinueOnAddOnLoaded etc.).
You don't have to install the addon manually — the DLL embeds
the contents of AddOns/!!!ClassicAPI/ and
registers them with the engine as a synthetic addon on startup, so
the library is always available when the DLL is loaded. It fires
ADDON_LOADED, supports SavedVariables, and is resolvable by name —
IsAddOnLoaded("!!!ClassicAPI"), GetAddOnInfo("!!!ClassicAPI"), and
## Dependencies: !!!ClassicAPI all work as usual.
It is intentionally always-on and cannot be disabled. The library
provides FrameXML-compat fixes that other addons and the DLL's own
features rely on, so leaving it toggleable would let a user (or a
one-off character-select uncheck) silently break them. The DLL
therefore hides it from the character-select AddOns list and
force-enables it every login — so it never appears as a checkbox and
can't be switched off. Being hidden means it's omitted from the
index-based GetNumAddOns() / GetAddOnInfo(i) enumeration, but every
by-name lookup and dependency reference still resolves normally.
If you drop the folder into your Interface/AddOns/ directory, that
copy's files win — the DLL's embedded version only serves files when
the engine's normal scan doesn't already have a newer entry under that
name. Useful for editing the Lua locally without rebuilding the DLL.
The hidden + force-enabled treatment applies either way (it's keyed to
the addon name, not to which copy serves the files), so the local copy
is also absent from the AddOns list. The dispatch is transparent:
addons consuming Mixin, ColorMixin, TableUtil, etc. behave
identically in both cases.
Bundled addon: DebugTools
A 1.12.1 / Lua 5.0 backport of Blizzard's Blizzard_DebugTools addon
lives in AddOns/DebugTools/.
It's an independent addon — it doesn't use anything ClassicAPI adds, and
ClassicAPI works fine without it. It's bundled here because it's the
natural companion for testing and debugging anything written against the
1.12 Lua surface (with or without the ClassicAPI extensions).
Slash commands provided:
| Command | Purpose |
|---|---|
/dump <expr> |
Pretty-print any Lua value, including tables and multi-return tuples. The right tool for inspecting return values from GetSpellInfo, C_Item.GetItemInfoInstant, etc. |
/etrace |
Event tracer window. /etrace start, /etrace stop, /etrace add EVENT, etc. |
/framestack (or /fstack) |
Tooltip showing the frame hierarchy under the mouse cursor. |
/luaerrors (or /scripterrors) |
Lua error display window. |
Lua globals provided (backports of Blizzard helpers):
| Global | Purpose |
|---|---|
print(...) |
Backport of Blizzard's print — concats varargs with " " and pushes to DEFAULT_CHAT_FRAME. Routes through setprinthandler's handler; falls back via geterrorhandler if the handler errors. |
setprinthandler(func) / getprinthandler() |
Install / query a custom print handler. Useful for redirecting print output in tests. |
tostringall(...) |
Apply tostring() to every vararg, preserving the count. Lua 5.0-compatible (uses arg.n since select doesn't exist in 5.0). |
To install: copy AddOns/DebugTools/ into your
Interface/AddOns/ directory like any other addon.
Building
Requires CMake (3.10+) and an MSVC toolchain that can target 32-bit Windows. WoW.exe is x86, so the DLL must be built as Win32; an x64 build will not load.
git submodule update --init --recursive # fetches MinHook, picojson, tinycbor
cmake -B build -A Win32
cmake --build build --config Release
The output is build/Release/ClassicAPI.dll.
To stamp a version into CLASSIC_API_VERSION, pass -DCLASSICAPI_TAG=vX.Y.Z
at configure time; the value exposed to Lua will be X*10000 + Y*100 + Z.
License
GPL v3 or later. See the headers in src/ for the full notice.