Skip to content

About

DLL for 1.12.1 to backport the modern Blizzard API

Resources

Stars

67 stars

Watchers

1 watching

Forks

Repository files navigation

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 — 950+ functions and 80+ 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.

Feature Effect
Lua 5.1 code Addon code written for Lua 5.1 runs on the 1.12 Lua 5.0 VM. It covers the 5.1 syntax (#, %, ... expressions, 0x hex, [=[ ]=] long brackets), method calls on strings (msg:match("^!(%w+)")), up to 60 upvalues for each function, and new for loop variables on each pass. Each addon file also gets its (name, table) through ....
Modern script handlers Frame scripts get their values as arguments, for example OnClick(self, button, down) and OnEvent(self, event, ...). XML script bodies such as <OnLoad>self:Init()</OnLoad> see self and their arguments by name. The this / arg1 globals stay set. SetModernScriptArgs(false) restores the vanilla behavior.
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.
Soft targeting The Interact Key and soft targets. Bind Interact With Target to a key to interact with the nearest NPC, corpse, mailbox, chest or gathering node in front of you. The softenemy and softfriend tokens point at the nearest enemy and friendly unit without a change of target. With no target, harmful spells go to softenemy and helpful spells go to softfriend. PLAYER_SOFT_*_CHANGED events fire when the units change.
Animations Animation groups on frames, textures and font strings, made in Lua or XML: CreateAnimationGroup, looping, smoothing, scripts and templates, with Alpha, Translation, Scale, Rotation and Path applied.
Tooltip line cap Removes GameTooltip's 30-line limit for every GameTooltipTemplate frame (GameTooltip, ShoppingTooltip1/2, ItemRefTooltip, AtlasLoot, …). A tooltip adds a new line pair when it needs one, so long tooltips and comparison blocks (for example, pfUI's eqcompare) keep all their lines.
XML attributes More XML attributes work: parentKey="Name" makes parent.Name point to a frame, texture or font string, <OnLoad function="Name"/> uses a global function as a script handler, <OnLoad method="Name"/> uses the frame's own function, mixin="A, B" copies mixins onto the object, <KeyValues> sets fields on the object, a button's <NormalFont style="..."/> sets its font, and inherits="A, B" applies more than one template. parentArray="Name" adds the object to a list on its parent. An <Anchor> takes x and y offsets and relativeKey="$parent.Key". <OnEnter inherit="prepend"> runs the template's handler and then its own, and inherit="append" runs them in the other order. A frame with intrinsic="true" makes a new frame type. Frames take scale, registerForDrag, clipChildren, useParentLevel, dontSavePosition, propagateKeyboardInput, propagateMouseInput, enableMouseClicks, enableMouseMotion and motionScriptsWhileDisabled, and buttons take registerForClicks. Textures take alpha, atlas, useAtlasSize, mask, desaturated, rotation, horizTile, vertTile, hWrapMode and vWrapMode. Font strings take alpha, wordwrap, indented, degrees and radians. Status bars take reverseFill, rotatesTexture and fillStyle, and edit boxes take countInvisibleLetters.
Macro conditions [conditions] and @unit work on 38 slash commands, from /cast and /use to /target, /follow, /cancelaura and the /pet family. With /cast [@mouseover,harm][] Fireball, the spell goes to the mouseover unit. With no mouseover unit, it goes to your target. @cursor places a ground-target spell or item under the mouse and @player places it at your feet. A character name works where a unit token does ([target=Feral]). Addons read the same rules through SecureCmdOptionParse.
#showtooltip A macro button shows the spell or item that its directive resolves to, conditions included: icon, tooltip, cooldown, range, usable state and auto-repeat glow. Action-bar addons get this with no code of their own. Addons with their own macro parser can publish through C_Macro.SetMacroDisplay.
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.
Combat log events COMBAT_LOG_EVENT_UNFILTERED and CombatLogGetCurrentEventInfo give each combat event with GUIDs and COMBATLOG_OBJECT_* flags. The values do not depend on the client language, so damage meters do not need to parse chat text. COMBAT_LOG_EVENT fires for the events that pass the CombatLogAddFilter filters.
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.
Addon memory and CPU usage Addon managers and performance tools can show how much Lua memory and CPU time each addon uses. GetAddOnMemoryUsage gives the memory of each addon. When scriptProfile is 1, the CPU functions give the time of each addon, function, frame, and event. With profiling off, the CPU functions cost nothing.
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.

Smaller behavior fixes, such as frame alpha and SetParent frame levels, are in docs/API.md with the API that they change.

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 — 950+ functions across ~75 namespaces

In the Frame rows, a name that starts with : is a method of the widget that the row names, for example :SetShown is frame:SetShown.

Namespace Calls
Action GetActionInfo, IsItemAction, IsStackableAction, HasBonusActionBar, C_ActionBar.EnableActionRangeCheck, C_ActionBar.GetSpell, C_ActionBar.GetItemActionOnEquipSpellID, C_ActionBar.IsStackableAction, C_ActionBar.IsMacroActionWithShowTooltip, C_ActionBar.FindSpellActionButtons, C_ActionBar.HasSpellActionButtons, C_ActionBar.IsOnBarOrSpecialBar
AddOns C_AddOns.DoesAddOnExist, C_AddOns.GetAddOnInterfaceVersion, 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
APIDocumentation /classicapi in-game browser, C_APIDocumentation.GetSystem, C_APIDocumentation.GetSystems
Animation region:CreateAnimationGroup, region:GetAnimationGroups, region:StopAnimating, SetMaxAnimFramerate, GetMaxAnimFramerate, AnimationGroup and Animation / Alpha / Translation / Scale / Rotation / Path / ControlPoint methods
AuctionHouse C_AuctionHouse.PostItem, CanCancelAuction
AutoComplete C_AutoComplete.GetAutoCompleteResults, C_AutoComplete.IsRecognizedName, C_AutoComplete.GetAutoCompletePresenceID, C_AutoComplete.GetAutoCompleteRealms
Bindings SetBindingSpell, SetBindingItem, SetBindingMacro, SetBindingClick, SetOverrideBinding, SetOverrideBindingSpell, SetOverrideBindingItem, SetOverrideBindingMacro, SetOverrideBindingClick, ClearOverrideBindings, GetBindingAction (checkOverride), GetBindingByKey, IsModifiedClick, GetModifiedClick, SetModifiedClick, GetNumModifiedClickActions, GetModifiedClickAction
Chat GetCurrentChatEvent, GetCurrentChatGUID, IsChatAFK, IsChatDND, SendSystemMessage
ChatBubbles C_ChatBubbles.GetAllChatBubbles
Class FillLocalizedClassList
ClassColor C_ClassColor.GetClassColor
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
CombatLog CombatLogGetCurrentEventInfo, COMBATLOG_OBJECT_* (constants)
Console CalculateStringEditDistance, ConsoleAddMessage, 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.RemoveTempCVar, C_CVar.SetCVar, C_CVar.SetCVarBitfield, C_CVar.SetTempCVar, GetCVar, GetCVarDefault
Cursor CursorHasMacro, 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.IsContainerFiltered, C_Container.IsContainerItemOpenable, C_Container.MoveItem, C_Container.PlayerHasHearthstone, C_Container.SetBackpackAutosortDisabled, C_Container.SetBagPortraitTexture, C_Container.SetBankAutosortDisabled, C_Container.SetItemSearch, C_Container.SetSortBagsRightToLeft, C_Container.SortBags, C_Container.SortBankBags, C_Container.SwapItems, C_Container.UseHearthstone, GetItemCooldown, SetBagPortraitTexture
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 GetCoinText, C_CurrencyInfo.GetCoinText, GetCoinTextureString, C_CurrencyInfo.GetCoinTextureString, Constants.MoneyFormattingConstants
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
DeathInfo C_DeathInfo.GetSelfResurrectOptions, C_DeathInfo.UseSelfResurrectOption
DurationUtil C_DurationUtil.CreateDuration, C_DurationUtil.CreateDurationTextBinding
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.PickupEquipmentSet, C_EquipmentSet.SaveEquipmentSet, C_EquipmentSet.UnignoreSlotForSave, C_EquipmentSet.UseEquipmentSet
Events C_EventUtils.IsEventValid, GetFramesRegisteredForEvent
Expansion ClassicExpansionAtLeast, ClassicExpansionAtMost, GetAccountExpansionLevel, GetClassicExpansionLevel, GetExpansionLevel, GetMaxPlayerLevel
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, CollapseAllFactionHeaders, ExpandAllFactionHeaders, GetFactionIDByIndex, GetFactionInfoByID, GetFactionParentID
Focus ClearFocus, FocusUnit
Frame: Region :SetPoint("point") (one-arg form), :SetSize / :GetSize, ignoreRect on :GetSize / :GetWidth / :GetHeight, :GetUnscaledWidth / :GetUnscaledHeight / :GetUnscaledSize, :GetRect, :GetScaledRect, :IsRectValid, :GetPointByName, :ClearPoint, :GetScale / :GetEffectiveScale (on textures and font strings), :GetDebugName, :IsMouseOver, :IsDragging, :IsProtected / :CanChangeProtectedState
Frame: Frame CreateFrame template lists and id, GetMouseFoci, :SetShown, :SetClampRectInsets / :GetClampRectInsets, :SetResizeBounds, :SetClipsChildren / :DoesClipChildren, :GetBoundsRect, :GetEffectiveAlpha, :SetAlphaGradient / :ClearAlphaGradient / :HasAlphaGradient, :DesaturateHierarchy, :HookScript, :IsEventRegistered, :RegisterUnitEvent, :SetPropagateKeyboardInput / :GetPropagateKeyboardInput, :SetDontSavePosition / :GetDontSavePosition, :SetAttribute, :SetAttributeNoHandler, :ClearAttribute, :GetAttribute, :CanChangeAttribute, :AllowAttributeChanges
Frame: Button :SetEnabled, :SetFormattedText, :SetNormalFontObject / :GetNormalFontObject, :SetMotionScriptsWhileDisabled / :GetMotionScriptsWhileDisabled, :RegisterForClicks("AnyUp"/"AnyDown"), :RegisterForMouse, GetClickFrame
Frame: FontString :GetStringHeight, :GetUnboundedStringWidth, :GetWrappedWidth, :GetNumLines, :GetLineHeight, :GetFontHeight / :SetFontHeight (also on fonts), :GetFieldSize, :IsTruncated, :SetMaxLines / :GetMaxLines, :SetWordWrap / :CanWordWrap, :SetIndentedWordWrap / :GetIndentedWordWrap (also on fonts, edit boxes, message frames, and SimpleHTML), :SetFormattedText, :SetRotation / :GetRotation
Frame: Texture :SetRotation / :GetRotation, :SetVertexOffset / :GetVertexOffset, :SetColorTexture, :SetAtlas / :GetAtlas, :ResetTexCoord, :SetSpriteSheetCell, :SetTexture wrap modes, :SetHorizTile / :GetHorizTile, :SetVertTile / :GetVertTile, :SetDesaturation / :GetDesaturation, IsDesaturateSupported, :SetMask, frame:CreateMaskTexture, :AddMaskTexture / :RemoveMaskTexture, :GetNumMaskTextures, :GetMaskTexture
Frame: EditBox :SetCursorPosition / :GetCursorPosition, :GetUTF8CursorPosition, :ClearHighlightText, :SetHighlightColor / :GetHighlightColor, :HasFocus, GetCurrentKeyBoardFocus, :HasText, :ClearHistory, :Enable / :Disable / :IsEnabled, :SetCountInvisibleLetters / :IsCountInvisibleLetters, :IsInIMECompositionMode
Frame: StatusBar :SetReverseFill / :GetReverseFill, :SetRotatesTexture / :GetRotatesTexture, :SetFillStyle / :GetFillStyle, :SetColorFill, :SetStatusBarDesaturated / :IsStatusBarDesaturated, :SetStatusBarDesaturation / :GetStatusBarDesaturation, :SetTimerDuration / :GetTimerDuration, :SetValue / :SetMinMaxValues with interpolation, :GetInterpolatedValue, :IsInterpolating, :SetToTargetValue
Frame: Slider :Enable / :Disable / :IsEnabled
Frame: Cooldown CreateFrame("Cooldown"), :SetCooldown, :SetCooldownDuration, :SetCooldownFromExpirationTime, :Clear, :GetCooldownTimes, :GetCooldownDuration, :GetCooldownDisplayDuration, :Pause / :Resume, :SetPaused / :IsPaused, :SetReverse / :GetReverse, :SetDrawEdge / :GetDrawEdge, :SetDrawSwipe / :GetDrawSwipe, :SetDrawBling / :GetDrawBling, :SetSwipeColor, :SetEdgeColor, :SetSwipeTexture, :SetEdgeTexture, :SetBlingTexture, :SetRotation / :GetRotation, :SetHideCountdownNumbers / :GetHideCountdownNumbers, :GetCountdownFontString, :SetCountdownAbbrevThreshold / :GetCountdownAbbrevThreshold, :SetCountdownMillisecondsThreshold / :GetCountdownMillisecondsThreshold, :SetMinimumCountdownDuration / :GetMinimumCountdownDuration, OnCooldownDone, CooldownFrame_Set, CooldownFrame_Clear, CooldownFrame_SetDisplayAsPercentage
Frame: ScrollingMessageFrame :SetHyperlinksEnabled / :GetHyperlinksEnabled, :GetMessageInfo (with the extra :AddMessage values), :BackFillMessage (adds a message as the oldest), :RemoveMessagesByPredicate, :SetScrollOffset / :GetScrollOffset, :GetMaxScrollRange, :ScrollByAmount, :SetInsertMode / :GetInsertMode, :AddOnDisplayRefreshedCallback
Frame: scripts OnEnable, OnDisable, OnMinMaxChanged, OnAttributeChanged, OnCharComposition, OnTextChanged (userInput), PreClick, PostClick, SetModernScriptArgs / GetModernScriptArgs
FriendList AddOrRemoveFriend, 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
GameTooltip GameTooltip:AddSpellByID, GameTooltip:AddTexture, GameTooltip:GetGameObject, GameTooltip:GetItem, GameTooltip:GetMinimumWidth, GameTooltip:GetOwner, GameTooltip:GetPadding, GameTooltip:GetSpell, GameTooltip:GetUnit, GameTooltip:GetUnitGUID, GameTooltip:HasGameObject, GameTooltip:HasItem, GameTooltip:HasSpell, GameTooltip:HasUnit, GameTooltip:IsEquippedItem, GameTooltip:IsUnit, GameTooltip:SetAnchorType, GameTooltip:SetEquipmentSet, GameTooltip:SetFrameStack, GameTooltip:SetHyperlink (full links, spell:, quest:), GameTooltip:SetHyperlinkCompareItem, GameTooltip:SetInventoryItemByID, GameTooltip:SetItemByGUID, GameTooltip:SetItemByID, GameTooltip:SetSpellByID, GameTooltip:SetTalentByID, GameTooltip:SetTotem, GameTooltip:SetUnitAura, OnTooltipSetItem, OnTooltipSetSpell, OnTooltipSetUnit, OnTooltipSetGameObject, OnTooltipSetFrameStack (scripts)
Gossip C_GossipInfo.CloseGossip, C_GossipInfo.GetActiveQuests, C_GossipInfo.GetAvailableQuests, C_GossipInfo.GetNumActiveQuests, C_GossipInfo.GetNumAvailableQuests, C_GossipInfo.GetNumOptions, C_GossipInfo.GetOptions, C_GossipInfo.GetPoiForUiMapID, C_GossipInfo.GetPoiInfo, C_GossipInfo.GetText, C_GossipInfo.SelectActiveQuest, C_GossipInfo.SelectAvailableQuest, C_GossipInfo.SelectOption, C_GossipInfo.SelectOptionByIndex, GetNumGossipActiveQuests, GetNumGossipAvailableQuests, GetNumGossipOptions
Hooks hooksecurefunc
Input GetMouseButtonClicked, GetMouseButtonName, IsLeftAltKeyDown, IsLeftControlKeyDown, IsLeftShiftKeyDown, IsModifierKeyDown, IsMouseButtonDown, IsRightAltKeyDown, IsRightControlKeyDown, IsRightShiftKeyDown
Instance GetInstanceInfo, IsActiveBattlefieldArena
Item: C_Item C_Item.DoesItemExist / C_Item.DoesItemExistByID, C_Item.EquipItemByName, C_Item.GetCurrentItemLevel, C_Item.GetDetailedItemLevelInfo, C_Item.GetEnchantInfo, C_Item.GetItemClassInfo, C_Item.GetItemCount, C_Item.GetItemData / C_Item.GetItemDataByID, 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.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.IsUsableItem, C_Item.ItemHasRange, C_Item.LockItem, C_Item.LockItemByGUID, C_Item.UnlockItem, C_Item.UnlockAllItems, C_Item.PickupItem, C_Item.RequestLoadItemData / C_Item.RequestLoadItemDataByID, C_Item.UseAtCursor, C_Item.UseAtUnit, C_Item.UseItemByName
Item: info GetItemClassInfo, GetItemSubClassInfo, GetItemIcon, IsConsumableItem, IsCurrentItem, IsDressableItem, IsEquippedItemType, IsHarmfulItem, IsHelpfulItem, IsUsableItem
Item: inventory GetAverageItemLevel, GetInventoryItemID, GetInventoryItemDurability, GetInventoryItemRepairCost, GetInventoryItemsForSlot, IsDualWielding, SetInventoryPortraitTexture
Item: item IDs GetAuctionItemID, GetAuctionSellItemID, GetCraftReagentItemID, GetInboxItemID, GetLootRollItemID, GetLootSlotItemID, GetMerchantItemID, GetQuestItemID, GetQuestLogItemID, GetTradePlayerItemID, GetTradeTargetItemID, GetTradeSkillItemID, GetTradeSkillReagentItemID
Localization AbbreviateLargeNumbers, AbbreviateNumbers, BreakUpLargeNumbers, C_StringUtil.GetDefaultAbbreviationBreakpoints
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, C_LossOfControl.GetSchoolLockout
Lua collectgarbage (5.1 options), coroutine.create, coroutine.resume, coroutine.running, coroutine.status, coroutine.wrap, coroutine.yield, CreateFromMixins, debuglocals, debugstack (coroutine argument), difftime, GetCallstackHeight, GetErrorCallstackHeight, gmatch, math.cosh, math.fmod, math.huge, math.modf, math.sinh, math.tanh, Mixin, newproxy, scrub, select, SetErrorCallstackHeight, strbyte (range args), strcmputf8i, strconcat, string.byte (range args), string.concat, string.format (two-digit %n$), string.gmatch, string.gsub (table replacement, %0), string.join, string.match, string.reverse, string.split, string.trim, strjoin, strlenutf8, strmatch, strreplace, strrev, strsplit, strsplittable, strtrim, table.count, table.maxn, table.removemulti, table.wipe, unpack (range args), wipe, xpcall (argument forwarding)
Macros C_Macro.CreateMacro, C_Macro.EditMacro, C_Macro.SetMacroDisplay, DeleteMacro / EditMacro / GetMacroInfo / PickupMacro by name, GetLooseMacroIcons, GetLooseMacroItemIcons, GetMacroBody, GetMacroIcons, GetMacroItem, GetMacroItemIcons, GetMacroSpell, GetRunningMacro, GetRunningMacroButton, RunMacroText, SetMacroItem, SetMacroSpell, StopMacro
Mail 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.GetExploredAreaIDsAtPosition, 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, GetBuybackItemLink
Model DressUpModel:TryOn (links, recipes, names, hand, enchant glow, result), DressUpModel:UndressSlot, DressUpModel:IsGeoReady, DressUpModel:SetSheathed / GetSheathed, DressUpModel:SetAutoDress / GetAutoDress, Model:SetGlow, PlayerModel:RefreshCamera, PlayerModel:SetCamDistanceScale, PlayerModel:SetCreature (displayID), PlayerModel:SetDisplayInfo, PlayerModel:SetItem, PlayerModel:SetPortraitZoom, PlayerModel:SetRotation (animate), PlayerModel:SetUnit (result), PlayerModel:CanSetUnit, PlayerModel:GetDisplayInfo, PlayerModel:SetAnimation, PlayerModel:FreezeAnimation, PlayerModel:HasAnimation, PlayerModel:SetDoBlend / GetDoBlend, PlayerModel:SetKeepModelOnHide / GetKeepModelOnHide, PlayerModel:ApplySpellVisualKit
NamePlate C_NamePlate.GetNamePlateForGUID, C_NamePlate.GetNamePlateForUnit, C_NamePlate.GetNamePlateGUIDs, C_NamePlate.GetNamePlates
NameCache C_PlayerCache.GetPlayerInfoByName, C_PlayerCache.IsEnabled, C_PlayerCache.RememberPlayer, C_PlayerCache.SetEnabled, GetPlayerInfoByGUID, UnitNameFromGUID
NewItems C_NewItems.ClearAll, C_NewItems.IsNewItem, C_NewItems.RemoveNewItem
PartyInfo InviteUnit, PromoteToLeader, UninviteUnit
Pet IsPetAttackAction, IsAtStableMaster
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
Profiling GetAddOnCPUUsage, GetAddOnMemoryUsage, GetEventCPUUsage, GetFrameCPUUsage, GetFunctionCPUUsage, GetScriptCPUUsage, ResetCPUUsage, UpdateAddOnCPUUsage, UpdateAddOnMemoryUsage
Quest C_QuestLog.GetInfo, C_QuestLog.GetNumQuestObjectives, C_QuestLog.GetQuestDetails, C_QuestLog.GetQuestLogTitle, C_QuestLog.GetHeaderIndexForQuest, C_QuestLog.GetLogIndexForQuestID, C_QuestLog.GetQuestIDForLogIndex, C_QuestLog.GetTitleForQuestID, C_QuestLog.IsOnQuest, C_QuestLog.IsQuestDataCachedByID, C_QuestLog.IsUnitOnQuest, C_QuestLog.RequestLoadQuestByID, GetQuestLogCompletionText, GetQuestLogLeaderBoardID (Turtle WoW only: C_QuestLog.GetAllCompletedQuestIDs, C_QuestLog.IsQuestFlaggedCompleted, GetQuestsCompleted, QueryQuestsCompleted)
Sound C_Sound.GetRecentSoundFiles, C_Sound.GetSoundScaledVolume, C_Sound.IsPlaying, C_Sound.PlayItemSound, C_Sound.PlaySound, C_Sound.PlaySoundWithOptions, C_Sound.PlayVocalErrorSound, MuteSoundFile, PlaySound, PlaySoundFile, StopSound, UnmuteSoundFile
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, CancelUnitBuff, CastSpellByID, CastSpellNoToggle, GetCraftSpellID, GetCritChance, GetRangedCritChance, GetSpellBaseCooldown, GetSpellBonusDamage, GetSpellBonusHealing, GetSpellInfo, GetSpellLink, GetSpellRadius, GetSpellRequiredTargetLevel, GetSpellSchool, IsAttackSpell, IsAutoRepeatSpell, IsConsumableSpell, IsHarmfulSpell, IsHelpfulSpell, IsPassiveSpell, IsPlayerSpell, IsSpellKnown, IsUsableSpell, SpellHasRange, UnitCastingDuration, UnitChannelDuration
SpellActivationOverlay C_SpellActivationOverlay.IsSpellOverlayed, IsSpellOverlayed
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, GetShapeshiftForm, GetShapeshiftFormID, GetSheathState, IsAssistingRitual, IsFalling, IsIndoors, IsInGroup, IsInRaid, IsLoggedIn, IsLoggingOut, IsMounted, IsOutdoors, IsPlayerInWorld, IsStealthed, IsSwimming
SwingTimer C_SwingTimer.EnableRangeCheck, C_SwingTimer.IsTargetWithinSwingRange
System CopyToClipboard, FlashClientIcon, GetPhysicalScreenSize
Talent GetTalentIDByIndex, GetTalentSpellID
Targeting GetPlayerFacing, TargetDirectionEnemy, TargetDirectionFriend, TargetDirectionFinished, TargetNearest, TargetNearestEnemyPlayer, TargetNearestFriendPlayer, InteractUnit, C_PlayerInteractionManager.InteractUnit, IsTargetLoose
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, SetPortraitTextureFromCreatureDisplayID
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, GetTickTime, GetTimeCached
Totem GetTotemInfo, GetTotemTimeLeft, GetTotemDuration, TargetTotem
Tracking GetNumTrackingTypes, GetTrackingInfo, SetTracking
TradeSkillUI GetTradeSkillListLink, GetCraftListLink, GetTradeSkillDescription, GetTradeSkillRecipeLink, IsTradeSkillLinked, IsCraftLinked
Trainer GetTrainerServiceItemLink
UIColor C_UIColor.GetColors
Unit CanBeRaidTarget, ClosestUnitPosition, GetUnitSpeed, IsUnitToken, SetUnitCursorTexture, UnitClassBase, UnitCreatedBySpell, UnitCreatureFamilyID, UnitCreatureID, UnitCreatureTypeID, UnitDistanceSquared, UnitFacing, UnitGUID, UnitHasIncomingResurrection, UnitHealthMissing, UnitInLineOfSight, UnitInRange, UnitIsAFK, UnitIsDND, UnitIsFeignDeath, UnitIsInMyGuild, UnitIsMinion, UnitIsOtherPlayersPet, UnitIsPet, UnitIsPossessed, UnitOwnerGUID, UnitPosition, UnitPower, UnitPowerMax, UnitPowerMissing, UnitPowerType, UnitRaceBase, UnitSelectionColor, UnitSelectionType, UnitSpellHaste, UnitSpellTargetName, UnitStandState, UnitSubName, UnitTokenFromGUID, UnitTokenFromName
UnitAuras C_UnitAuras.GetAuraDataByAuraInstanceID, 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, C_CVar.SetTempCVar, C_CVar.RemoveTempCVar (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 — forms a macro body accepts

The DLL parses these forms, so an action-bar addon needs no code for them. See the Macros section in the Lua reference for details.

Form What it does
#showtooltip [conditions] Value First line of a macro. Sets what the button shows. Bare #showtooltip follows the first /cast or /use line instead. #show is the same form.
[conditions] and @unit Accepted by 42 commands. The slash-command list below names them.
!Name Starts an ability but never turns it off. Use it for auto-repeat shots and for the self-buffs (stance, aspect, seal, form, tracking).
A line that starts with # A comment. The line never reaches chat.
/cast <spellID> For a spell you know, /cast 5019 casts it by ID. The macro slot also tags correctly for an action-bar addon.
CastSpellByName("<spellID>") A numeric string resolves through the engine name resolver, the same as /cast.
CastSpellNoToggle("<name>") in a macro The engine macro parser reads this as a primary-spell line. The macro slot in an addon such as pfUI then highlights while the spell is on auto-repeat or its self-aura is active.
Slash commands — [conditions] on 42 commands

The bundled addon registers these commands. Each one takes the same [conditions] and @unit syntax as /cast. Each client language has its own command names next to the English ones. See More commands with [conditions] for what each command does, and /castsequence and /castrandom for the list forms.

Group Commands
Casting /cast, /use, /castsequence, /castrandom, /userandom, /stopcasting, /stopmacro, /cancelaura, /cancelform, /dismount
Targeting /target, /targetexact, /cleartarget, /targetlasttarget, /targetlastenemy, /targetenemy, /targetfriend, /targetenemyplayer, /targetfriendplayer, /targetparty, /targetraid, /assist, /follow, /focus, /clearfocus, /startattack, /stopattack
Equipment /equip, /equipslot, /equipset
Action bars /changeactionbar, /swapactionbar, /click
Pet /petattack, /petfollow, /petstay, /petpassive, /petdefensive, /petaggressive, /petautocaston, /petautocastoff, /petautocasttoggle
CVars — new settings, set with /console name value

Each setting is saved in WTF\Config.wtf. Read and write them with GetCVar / SetCVar or /console. Click a group name for the full rules. To change these settings, the player cache and the ClassicAPI key bindings in the game, open the game menu and click AddOn Options, then ClassicAPI.

Group CVar Default What it does
Bindings ActionButtonUseKeyDown 0 1 uses an action-bar key binding when you press the key. 0 uses it when you release the key.
Combat stopAutoAttackOnTargetChange 0 1 stops melee auto-attack, Auto Shot and wand shots when you change target.
Combat log combatLogRetentionTime 300 The number of seconds that the combat log keeps an entry.
Stand, dismount and form autoStand 0 1 makes you stand up when you cast, loot or open the flight map while you sit.
autoDismount 0 1 makes you dismount when you cast, use an object, loot, attack or open the flight map while you are mounted.
autoUnshift 0 1 makes you leave your form when you cast a spell that cannot be cast in it, use an item, or open the flight map. It also lets you talk to NPCs and use objects in druid forms and Ghost Wolf.
Bag sorting sortBagsRightToLeft 0 1 makes a sort fill your bags from the last slot of the last bag.
backpackAutosortDisabled 0 1 keeps the items in your backpack in place when you sort your bags.
bankAutosortDisabled 0 1 keeps the items in the main bank slots in place when you sort your bank.
Expanded cursors expandedCursors 0 1 makes the cursor show what you can do with an NPC or an object: an anvil for repairs, a hearthstone for an inn, a horseshoe for a stable, ! or ? for quests, and a fish hook for your fishing bobber.
Equipment sets dontShowEquipmentSetsOnItems 0 1 removes the Equipment Sets line from item tooltips.
Name completion autoCompleteResortNamesOnRecency 1 1 puts the players that you whispered first in C_AutoComplete results, the most recent first. 0 uses alphabetical order.
autoCompleteWhenEditingFromCenter 1 1 also matches the text after the cursor when you type inside a name.
autoCompleteUseContext 1 0 makes C_AutoComplete ignore includeFlags and excludeFlags.
Profiling scriptProfile 0 1 turns on CPU profiling for the *CPUUsage functions. The change starts after /reload.
Soft interact SoftTargetInteract 3 Turns softinteract on: 2 keyboard and mouse, 3 always, 0 / 1 off.
SoftTargetInteractArc 0 Where the object can be: 0 straight ahead of the camera, 1 within 30° of it, 2 any direction.
SoftTargetInteractRange 10 Maximum distance in yards.
SoftTargetInteractRangeIsHard 0 1 always applies the range. 0 also picks an object past it that you can use now.
SoftTargetIconInteract 0 1 shows an icon over the soft-interact object.
SoftTargetIconGameObject 0 1 also shows that icon over game objects.
Soft enemy / friend SoftTargetEnemy / SoftTargetFriend 1 / 0 Turns softenemy / softfriend on: 2 keyboard and mouse, 3 always, 0 / 1 off.
SoftTargetEnemyArc / SoftTargetFriendArc 0 The same values as SoftTargetInteractArc.
SoftTargetEnemyRange / SoftTargetFriendRange 45 Maximum distance in yards.
SoftTargetMatchLocked 1 1 uses your target as the soft unit when it qualifies. 0 always uses the nearest unit.
SoftTargetWithLocked 1 0 turns soft enemy and soft friend off while you have a locked target.
SoftTargetForce 1 A loose target follows softenemy (1) or softfriend (2). 0 keeps it.
SoftTargetIconEnemy / SoftTargetIconFriend 0 1 shows an icon over softenemy / softfriend.
SoftTargetLowPriorityIcons 0 1 also shows the normal pointer as an icon.
SoftTargetNameplateSize 19 Size of all soft-target icons.
Localization breakUpLargeNumbers 1 1 puts a separator between each group of three digits in BreakUpLargeNumbers. 0 writes no separator.
Cooldown countdownForCooldowns 0 1 shows the time left as numbers on cooldown frames.
ScriptAnimationUtil ShakeStrengthUI 1 Scales how far ScriptAnimationUtil.ShakeFrame moves a frame. 0 turns the shake off.
NamePlate nameplateNotSelectedAlpha 0.5 Alpha of a non-target default nameplate, 0 to 1.
nameplateSelectedAlpha 1 Alpha of the target's default nameplate, 0 to 1.
Text to speech ttsVoice 0 The voice that C_VoiceChat.SpeakText uses.
ttsSpeed 0 Speech rate, -10 to 10.
ttsVolume 100 Speech volume, 0 to 100.
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\
ExportSoundFiles [subpath] Extracts the client's sound files from the MPQs to BlizzardSound\; the optional subpath narrows it (the full tree is ~1 GB)
pitchLimit degrees Sets how far the camera can tilt up and down (default 89)
AppendLogToFile [filename] [numLines] Writes the console output to a text file (default ConsoleLogs\Log<Timestamp>.txt)
Tab / Ctrl+Tab Tab completes CVar names after set, cvar_reset and cvar_default; Ctrl+Tab lists every command that contains the typed text
Events — new events fired to addons
Event Payload
ACTION_RANGE_CHECK_UPDATE slot, isInRange, checksRange (slots with C_ActionBar.EnableActionRangeCheck on)
ACTION_USABLE_CHANGED changes (a { slot, usable, noMana } table for each slot that changed)
BAG_NEW_ITEMS_UPDATED (none)
BAG_UPDATE_DELAYED (none)
CHAT_MSG_* adds lineID, guid as arg11, arg12 after the existing ten (details)
COMBAT_LOG_EVENT timestamp, subevent, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ... (details)
COMBAT_LOG_EVENT_UNFILTERED same as COMBAT_LOG_EVENT
CURSOR_CHANGED isDefault, newCursorType, oldCursorType, oldCursorVirtualID
DYNAMIC_GOSSIP_POI_UPDATED (none)
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)
INCOMING_RESURRECT_CHANGED unitTarget
INVENTORY_SEARCH_UPDATE (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")
MAP_EXPLORATION_UPDATED (none)
MODIFIER_STATE_CHANGED keyName, down
NAME_PLATE_CREATED nameplateFrame
NAME_PLATE_UNIT_ADDED unitToken ("nameplateN")
NAME_PLATE_UNIT_REMOVED unitToken ("nameplateN")
PLAYER_AVG_ITEM_LEVEL_READY (none)
PLAYER_EQUIPMENT_CHANGED equipmentSlot, hasCurrent
PLAYER_FOCUS_CHANGED (none)
PLAYER_MOUNT_DISPLAY_CHANGED (none)
PLAYER_SOFT_ENEMY_CHANGED (none)
PLAYER_SOFT_FRIEND_CHANGED (none)
PLAYER_SOFT_INTERACT_CHANGED oldTarget, newTarget
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_SWING swingDuration, swingType
PLAYER_SWING_RANGE_UPDATE swingType, isInRange, checksRange
PLAYER_TOTEM_UPDATE totemSlot
QUEST_ACCEPTED questLogIndex, questID
QUEST_DATA_LOAD_RESULT questID, success
QUEST_QUERY_COMPLETE (none) (Turtle WoW only)
QUEST_REMOVED questID
QUEST_TURNED_IN questID, xpReward, moneyReward
SELF_RES_SPELL_CHANGED (none)
SOUNDKIT_FINISHED soundHandle (only for sounds played with runFinishCallback)
SPELL_ACTIVATION_OVERLAY_SHOW spellID, texture, locationType, scale, r, g, b (details)
SPELL_ACTIVATION_OVERLAY_HIDE spellID (nil hides every alert)
SPELL_ACTIVATION_OVERLAY_GLOW_SHOW spellID (details)
SPELL_ACTIVATION_OVERLAY_GLOW_HIDE spellID
UI_SCALE_CHANGED (none)
UNIT_AREA_CHANGED unitTarget
UNIT_AURA_DELTA unitTarget, updateInfo (the instance IDs of the auras added, updated, and removed)
UNIT_CONNECTION unitTarget, isConnected
UNIT_DISTANCE_CHECK_UPDATE unitTarget, isInDistance
UNIT_IN_RANGE_UPDATE unitTarget, isInRange
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
UNIT_SPELLCAST_INTERRUPTIBLE unit
UNIT_SPELLCAST_NOT_INTERRUPTIBLE unit
UNIT_MAXPOWER unitTarget, powerType
UNIT_POWER_FREQUENT unitTarget, powerType
UNIT_POWER_UPDATE unitTarget, powerType
UNIT_SPELL_HASTE unitTarget
UNIT_TARGET unitTarget
UNIT_TARGETABLE_CHANGED unitTarget
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)
WEAPON_SLOT_CHANGED (none)
WEAR_EQUIPMENT_SET setID
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)
Player swing type Enum.PlayerSwingType.{MainHand,OffHand,Ranged} (0–2)
Screen location type Enum.ScreenLocationType.{Center,Left,Right,Top,Bottom,TopLeft,TopRight,LeftOutside,RightOutside,LeftRight,TopBottom,LeftRightOutside} (0–11)
Self-resurrect option type Enum.SelfResurrectOptionType.{Spell,Item} (0–1)
Autocomplete entry flag Enum.AutoCompleteEntryFlag.{InGroup,InGuild,Friend,Bnet,InteractedWith,Online,InAOI,AccountCharacter,RecentPlayer} (bits 1–256)
Autocomplete priority Enum.AutoCompletePriority.{Other,Interacted,InGroup,Guild,Friend,AccountCharacter,AccountCharacterSameRealm} (0–6)
Unit tokens — nameplateN, focus, markN, softinteract, softenemy, softfriend, anyinteract, anyenemy, anyfriend
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).
softinteract / anyinteract / anyleftinteract The object that the Interact Key uses. softinteract is the nearest object in front of you that you can interact with. anyinteract is your target when you can interact with it, else softinteract. Both can be a game object or a corpse, which only UnitGUID reads. See Soft interact.
softenemy / softfriend / anyenemy / anyfriend The nearest enemy and the nearest friendly unit, or your target when it qualifies. anyenemy and anyfriend use your target first. See Soft enemy and soft friend.
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:

  1. Install VanillaFixes if it isn't already.
  2. Copy ClassicAPI.dll into your game directory.
  3. Add ClassicAPI.dll to dlls.txt.
  4. Launch the game with VanillaFixes.exe.

The !!!ClassicAPI, ClassicAPI_DebugTools and ClassicAPI_EventTrace addons are inside the DLL. You do not download or install them. The src/embed/AddOns/ folder in this repository is source code for the DLL. Do not copy it into your game.

Bundled addon: !!!ClassicAPI

The Lua-side companion library lives in src/embed/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.), EventUtil (ContinueOnAddOnLoaded and more), FormattingUtil (GetMoneyString, FormatLargeNumber and more), FrameUtil, DataProvider, CircularBuffer, EasingUtil, ScriptAnimationUtil, Interpolator, EnumUtil, StringUtil, AnchorUtil, GridLayoutUtil, and the layout frame templates (VerticalLayoutFrame, HorizontalLayoutFrame, ResizeLayoutFrame, GridLayoutFrame, StaticGridLayoutFrame). It also holds the conditional slash commands and SecureCmdOptionParse, the parser that reads [conditions] and @unit for them.

You don't have to install the addon manually — the DLL embeds the contents of src/embed/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.

For development, you can put a copy of the addon folder in Interface/AddOns/ and add an empty .classicapi-dev file to it. The game then reads the Lua files from that copy, so you can edit them without a DLL rebuild. Without this file, the game uses the copy with the newer ## Version:. The copy is hidden and always enabled, the same as the embedded addon.

Lua errors

ClassicAPI replaces the game's Lua error box with a Lua error window. The window opens when an error occurs. It shows the message, the time, the count, the stack and the local variables of each error. You can select and copy the text. The arrow buttons show the previous and the next error. The Reload UI button reloads the interface.

If you use !BugGrabber (with BugSack), BugGrabber gets the errors and the window does not open. If an addon sets its own error handler, the window also does not open.

Command Purpose
/luaerrors (or /scripterrors) Opens or closes the Lua error window.
/luaerrors clear Removes all errors from the window.

Debug tools

ClassicAPI contains backports of two Blizzard addons: Blizzard_DebugTools, with the name ClassicAPI_DebugTools, and Blizzard_EventTrace, with the name ClassicAPI_EventTrace. The DLL contains these addons, so you do not install them. They are not in the AddOns list, and you cannot disable them.

The slash commands are always available. Each addon loads the first time that you use one of its commands:

Command Purpose
/dump <expr> Shows a Lua value in the chat frame. It shows tables and all return values. Use it to examine the return values of GetSpellInfo, C_Item.GetItemInfoInstant, and other functions.
/etrace (or /eventtrace) Opens or closes the event trace window. The window logs each event with its time and its arguments. Move the mouse over an event to see its arguments, and the contents of each table argument. You can search the log, hide events with the filter, and pause the log. /etrace mark <text> adds a line of text to the log.
/framestack [showHidden [showRegions]] (or /fstack) Shows a tooltip with a list of the frames under the cursor. A --> mark shows one frame, with its anchors and the file and line that made it. Left Alt and Right Alt move the mark. Ctrl opens the marked frame in the table inspector. Shift shows its texture files. The tooltip also shows the addon that made the marked frame. When scriptProfile is 1, it shows the CPU time of the frame scripts.
/tinspect [expr] (or /tins) Opens a table inspector on the result of expr. With no table, it opens on the frame under the cursor. The window shows the anchors and the fields of the table, grouped by type. You can edit numbers, strings and booleans, filter the lines, and open a child table or frame.
/profiler (or /prof) Opens the profiler. The profiler shows the Lua memory, the allocations and the CPU time of each addon, frame, event and global function. /profiler widget shows a small window with the Lua memory, the frame rate and the addons that use the most. /profiler reset sets the counters to zero. CPU times need scriptProfile 1. /profiler profile on sets it and reloads the UI.

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.

About

DLL for 1.12.1 to backport the modern Blizzard API

Resources

Stars

67 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages