World of Warcraft API
From WoWWiki
| Main Menu |
|---|
|
|
The World of Warcraft API is a set of functions, provided by Blizzard, that allow you to interact and modify the World of Warcraft game through the use of addons and macros. Below is an almost complete list of every function provided by Blizzard that you can use in the creation of your addon or macro. Enjoy the list, and remember if you come across a function that is not documented, please submit it to WoWWiki so we can continue to have a complete list of functions available for your use.
Editing Notes:
- Read How to edit API pages.
- Please follow the standard API Notation and Conventions when editing.
- When you make changes to this page, please update the function's page as well (reached by clicking its link).
- Do not create stub pages without adding useful information to it. It is better that links to undocumented function remain red! If you do create a stub, tag it {{Stub/API}}.
- Before making large-scale changes, discuss them on the discussion page.
Usage Notes:
- Play around with the functions yourself by typing /script FunctionName(arg1,arg2,etc) into the chat edit box in WoW.
- Look at how Blizzard did it by examining the existing UI.
History:
- A change tracker for all of the API pages can be found here; Iriel's Wiki Change Tracker.
Notation:
- UI - Means that the function is implemented in Lua in Blizzard's User Interface (FrameXML) but was considered important enough to appear here.
- PROTECTED - This function can only be called from secure code. See the Protected Functions category.
- REMOVED - This function has been removed from the World of Warcarft API (and should also be removed from this list). For historical purposes, see the Removed Functions category.
Global Function Groups
This is an incomplete list of the WoW APIs. It likely will never be 100% complete, as new APIs are added all the time.
Here is a complete list of all global functions: Global Function List. If a function on that list is missing from this page, it's because no-one has added it yet. Before you add functions, please see How to edit API pages.
Account PlayTime Limit Functions
API functions for realms that run the play time reduction system, currently only active in Asia.
Action Functions
These functions are those which operate with the action buttons (General player actions are likely in the Activity Functions section below).
- PROTECTED UI ActionButtonDown(id) - Press the specified action button. (2.0 Protected)
- PROTECTED UI ActionButtonUp(id) - Release the specified action button. (2.0 Protected)
- ActionHasRange(slot) - Determine if the specified action is a range restriction (1 if yes, nil if no)
- UI BonusActionButtonDown - Trigger the specified bonus(pet or minion) action button.
- UI BonusActionButtonUp - Release the specified bonus(pet or minion) action button.
- PROTECTED CameraOrSelectOrMoveStart() - Begin "Left click" in the 3D world. (1.10 - Protected)
- PROTECTED CameraOrSelectOrMoveStop([stickyFlag]) - End "Left click" in the 3D world. (1.10 - Protected)
- ChangeActionBarPage() - Changes the current action bar page.
- GetActionBarPage() - Return the current action bar page. CURRENT_ACTIONBAR_PAGE is obsolete.
- GetActionBarToggles() - Return the toggles for each action bar.
- GetActionCooldown(slot) - This returns the cooldown values of the specified action..
- GetActionCount(slot) - Get the count (bandage/potion/etc) for an action, returns 0 if none or not applicable.
- GetActionInfo(slot) - Returns type, id, subtype.
- GetActionText(slot) - Get the text label (macros, etc) for an action, returns nil if none.
- GetActionTexture(slot) - Gets the texture path for the specified action.
- GetBonusBarOffset() - Determine which page of bonus actions to show.
- GetMouseButtonClicked() -Returns the name of the button that triggered a mouse down/up/click/doubleclick event. (NEW 2.0.3)
- HasAction(slot) - Returns 1 if the player has an action in the specified slot, nil otherwise.
- IsActionInRange(slot,[unit]) - Test if an action is in range (1=yes, 0=no, nil=not applicable).
- IsAttackAction(slot) - Return 1 if an action is an 'attack' action (flashes during combat), nil otherwise.
- IsAutoRepeatAction(slot) - Return 1 if an action is auto-repeating, nil otherwise.
- IsCurrentAction(slot) - Return 1 if an action is the one currently underway, nil otherwise.
- IsConsumableAction(slot) - Return 1 if an action is consumable (i.e. has a count), nil otherwise.
- IsEquippedAction(slot) - Return 1 if an action is equipped (i.e. connected to an item that must be equipped), nil otherwise.
- IsUsableAction(slot) - Return 1 if an action can be used at present, nil otherwise.
- PetHasActionBar() - Determine if player has a pet with an action bar.
- PickupAction(slot) - Drags an action out of the specified quickbar slot and holds it on the cursor.
- PickupPetAction(slot) - Drags an action from the specified pet action bar slot into the cursor.
- PlaceAction(slot) - Drops an action from the cursor into the specified quickbar slot.
- SetActionBarToggles(show1,show2,show3,show4[, alwaysShow]) - Set show toggle for each action bar - 'alwaysShow' added in 1.12
- StopAttack() - Turns off auto-attack, if currently active. Has no effect is the player does not currently have auto-attack active.
- PROTECTED TurnOrActionStart() - Begin "Right Click" in the 3D world. (1.10 - Protected)
- PROTECTED TurnOrActionStop() - End "Right Click" in the 3D world. (1.10 - Protected)
- PROTECTED UseAction(slot[, checkCursor[, onSelf]]) - This instructs the interface to use the action associated with the specified ID, optionally on the player (regardless of target)(2.0 - Protected).
Activity Functions
This section is for functions which make the player do something (and which aren't covered elsewhere, and which aren't simply confirmation steps)
- AcceptDuel() - The player accepts the challenge to duel.
- PROTECTED AttackTarget() - Attacks the targetted unit.
- CancelDuel() - Refuse the invitation to fight a duel.
- CancelLogout() - Cancels the logout timer (from camping or quitting).
- ClearTutorials()
- ConfirmSummon() - Accepts a summon request.
- PROTECTED DescendStop() - The player stops descending (while swimming or flying) -- added in 2.1
- Dismount() - The player dismounts the current mount. -- added in 2.0.3
- FlagTutorial("tutorial")
- PROTECTED ForceLogout()
- ForceQuit() - Instantly quits the game, bypassing the timer.
- GetSummonConfirmAreaName()
- GetSummonConfirmSummoner()
- GetSummonConfirmTimeLeft()
- Logout - Logs the user out of the game.
- Quit - Quits the game, not the Lua script.
- RandomRoll(low, high) - Does a random roll between the two values.
- PROTECTED SitStandOrDescendStart() - The player sits, stands, or descends -- added in 2.1
- PROTECTED StartDuel("name") - Challenge someone to a duel (by name) -- protected in 2.0
- TogglePVP() - Toggles PVP status
- ToggleSheath() - Toggles sheathed or unsheathed weapons.
- UseSoulstone() - Use an active soulstone to resurrect yourself after death.
AddOn Functions
- DisableAddOn(index or "AddOnName") - Disable the specified AddOn for subsequent sessions.
- DisableAllAddOns() - Disable all AddOns for subsequent sessions.
- EnableAddOn(index or "AddOnName") - Enable the specified AddOn for subsequent sessions.
- EnableAllAddOns() - Enable all AddOns for subsequent sessions.
- GetAddOnDependencies(index or "AddOnName") - Get dependency list for an AddOn.
- GetAddOnInfo(index or "AddOnName") - Get information about an AddOn.
- GetAddOnMetadata(index or "name", "variable") - Retrieve metadata from addon's TOC file.
- GetNumAddOns() - Get the number of user supplied AddOns.
- IsAddOnLoaded(index or "AddOnName") - Returns true if the specified AddOn is loaded.
- IsAddOnLoadOnDemand(index or "AddOnName") - Test whether an AddOn is load-on-demand.
- LoadAddOn(index or "AddOnName") - Request loading of a Load-On-Demand AddOn.
- ResetDisabledAddOns() -
Arena Functions
- ArenaTeamInviteByName(teamIndex, playerName) - Invites the specified player to the specified arena team.
- ArenaTeamLeave(teamIndex) - Leaves the specified arena team.
- ArenaTeamRoster(teamIndex) - Sends a request to the server to request the most recent information on a specific Arena Team that you are in.
- ArenaTeamUninviteByName(teamIndex, playerName) - Removes the specified played from the specified arena team.
- ArenaTeamDisband(teamIndex) - Disbands the arena team without any warning! Requires you to be the leader of the team. (Known to be implemented as of 2.1.3, but may have existed before).
- GetArenaCurrency() - Gets the amount of arena points a player currently has to spend.
- GetArenaTeam(teamIndex) - Returns information regarding the players arena team, nil if the player is not in the passed team
- GetArenaTeamRosterInfo(teamIndex, playerIndex) - Returns information regarding a player from the specified team, this requires a call to ArenaTeamRoster you only need to do this when the player logins in, UI reloads will not effect the return.
- GetNumArenaTeamMembers(teamIndex[, showOffline]) - Gets the number of arena team members, this requires a call to ArenaTeamRoster you only need to do this when the player logins in, UI reloads will not effect the return.
- GetBattlefieldTeamInfo(index) - Gets info about a registered Arena Team at the end of an arena match.
- GetCurrentArenaSeason() - Gets the current Arena season.
- IsActiveBattlefieldArena() - Returns true if in an Arena Match, also Returns true for the second argument if it's a registered match.
- IsArenaTeamCaptain(teamIndex) - Returns a value based on whether the player is the arena team captain.
- IsBattlefieldArena() - Returns true if the battlemaster you're talking to can queue you for arenas
Auction Functions
- CalculateAuctionDeposit(runTime) - Returns the required deposit for the current selling item given the specified duration (minutes).
- CanSendAuctionQuery() - Return 1 if auction search button would be active, nil otherwise.
- CancelAuction(index) - Cancel the specified auction (on the "owner" list).
- ClickAuctionSellItemButton() - Puts the currently 'picked up' item into the 'create auction' slot.
- CloseAuctionHouse() - Will close the AuctionFrame if opened.
- GetAuctionHouseDepositRate() - Returns the deposit rate (percentage) for the currently open auction house (Possibly out-dated by CalculateAuctionDeposit).
- GetAuctionInvTypes(classIndex, subclassIndex) - Returns types of subcategories items.
- GetAuctionItemClasses() - Returns major auction item categories.
- GetAuctionItemInfo("type", index) - Returns details about the specified auction item.
- GetAuctionItemLink("type", index) - Returns an itemLink for the specified auction item.
- GetAuctionItemSubClasses(classIndex) - Returns subcategories in the nth auction category.
- GetAuctionItemTimeLeft("type", index) - Returns the time left status of the specified auction item.
- GetAuctionSellItemInfo() - Returns information about the current selling item (or nil if none selected).
- GetBidderAuctionItems([page]) - ?.
- GetNumAuctionItems("type") - Returns the size of the specified auction item list.
- GetOwnerAuctionItems([page]) - ?.
- GetSelectedAuctionItem("type") - Returns the index (1-50) of the selected auction item or 0 if none is selected.
- IsAuctionSortReversed("type", "sort") - Returns 1 if the specified auction list and sort is reversed, nil otherwise.
- PlaceAuctionBid("type", index, bid) - Place a bid on the selected auction item.
- QueryAuctionItems("name", minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex) - ?.
- SetSelectedAuctionItem("type", index) - ?.
- SortAuctionItems("type", "sort") - Request that the specified auction list be sorted by a specific column.
- StartAuction(minBid, buyoutPrice, runTime) - Starts the auction you have created in the Create Auction panel.
- UI AuctionFrameAuctions.duration - Set the amount of time the auction will run for in minutes.
Bank Functions
- BankButtonIDToInvSlotID(buttonID, isBag) - Returns the ID number of a bank button or bag in terms of inventory slot ID.
- CloseBankFrame() - Close the bank frame if it's open.
- GetBankSlotCost(numSlots) - Returns the cost of the next bank slot.
- GetNumBankSlots() - Returns total purchased bank bag slots, and a flag indicating if it's full.
- PurchaseSlot() - Buys another bank slot if available.
Battlefield Functions
- AcceptAreaSpiritHeal() - Accept a spirit heal.
- AcceptBattlefieldPort(index[, acceptFlag]) - Accept or reject an offered battlefield port.
- CancelAreaSpiritHeal() - Cancel a spirit heal.
- CanJoinBattlefieldAsGroup() - returns nil if the player can not do a group join for a battlefield.
- CheckSpiritHealerDist() - Return true if you are in range with spirit healer while dead.
- CloseBattlefield() - Closes the queue for battlefield window.
- GetAreaSpiritHealerTime() - Returns the time left until the next resurrection by the Sprit Guide.
- GetBattlefieldEstimatedWaitTime(index) - Get the estimated wait for entry into the battlefield.
- GetBattlefieldFlagPosition(index) - Get the map position and texture of the flag.
- GetBattlefieldInfo(index) - Returns detailed information on the Battlefield you last opened a queue window for.
- GetBattlefieldInstanceExpiration() - Get shutdown timer for the battlefield instance.
- GetBattlefieldInstanceInfo(index) - Get the instance ID for a battlefield.
- GetBattlefieldInstanceRunTime() - In milliseconds, the time since battleground started. (seems to be queried from server because it is not in sync with time())
- GetBattlefieldMapIconScale() - Scale of the landmark icons on the battlefield minimap.
- GetBattlefieldPortExpiration(index) - Get the remaining milliseconds before the battlefield port expires.
- GetBattlefieldPosition(index) - Get the map position and name of a player in the battleground not in your raid.
- GetBattlefieldScore(index) - Get score information about a player.
- GetBattlefieldStatData(playerIndex, slotIndex) - Get information for a player from a column thats specific to a battleground. (like Warsong Gulch flag captures)
- GetBattlefieldStatInfo(index) - Get the battleground specific column for the score board.
- GetBattlefieldStatus(index) - Get the battlefield's current status.
- GetBattlefieldTimeWaited(index) - Get time waited in queue in milliseconds.
- GetBattlefieldWinner() - Get the battlefields winner.
- GetHonorCurrency() - Gets the amount of honor points the player currently has to spend.
- GetNumBattlefieldFlagPositions() - Get the number of flag positions available from GetBattlefieldFlagPosition().
- GetNumBattlefieldPositions() - Get the number of positions available from GetBattlefieldPosition().
- GetNumBattlefields() - Get the number of running battlefields for the last battleground queue window you opened.
- GetNumBattlefieldScores() - Returns the number of scores(players) listed in the battlefield scoreboard.
- GetNumBattlefieldStats() - Get the number of battleground specific columns.
- GetNumWorldStateUI() - Get the number of WorldState UI's.
- GetSelectedBattlefield() - Get the selected battlefield to join first.
- GetWorldStateUIInfo(i) - Get score and flag status within a battlefield.
- JoinBattlefield(index[, joinAs]) - Queue for a battleground either solo or as a group.
- LeaveBattlefield() - Leave the current battlefield
- ReportPlayerIsPVPAFK("unit") - Reports the specified player as AFK in a battleground.
- RequestBattlefieldPositions() - Request new data for GetBattlefieldPosition().
- RequestBattlefieldScoreData() - Request new data for GetBattlefieldScore().
- SetBattlefieldScoreFaction([faction]) - Set the faction to show on the battlefield scoreboard.
- SetSelectedBattlefield(index) - Select the battlefield instance you want to join or the first one that becomes available.
- ShowBattlefieldList(index) - Displays a queue window for the specified battlefield. Only works if you are already in a queue for the battlefield. Index corresponds to location in queue array.
Binding Functions
- GetBinding(index) - Get action and key bindings for that index.
- GetBindingAction("KEY" [,checkOverride]) - Get the action bound to that key.
- GetBindingKey("command") - Get the key(s) bound to that action.
- UI GetBindingText("key", "prefix", returnAbbr) - Gets the string value for the key.
- GetCurrentBindingSet() - Queries if current set of key bindings is character or account specific
- GetNumBindings() - Get total number key bindings and headers.
- LoadBindings(which) - Loads default, account or character specific key binding set into memory from disk.
- RunBinding("command"[, "up"]) - Executes the key binding named "command"
- SaveBindings(which) - Saves account or character specific key bindings from memory to disk.
- SetBinding("key"[, "command"]) - Sets or unsets key bindings. (2.0 - Can not be used in combat.)
- SetBindingSpell("KEY", "Spell Name") - Set a key binding directly to a spell, uses the same spell name syntax as /cast.
- SetBindingClick("KEY", "ButtonName" [,"mouseButton"]) - Set a key binding directly to a Button object. The click sends a mouse down when the key is pressed, and a mouse up when it is released.
- SetBindingItem("KEY", "itemname") -
- SetBindingMacro("KEY", "macroname"|macroid) -
- SetConsoleKey("key") - Sets the console key (normally "`").
- SetOverrideBinding(owner, isPriority, "KEY" [,"COMMAND"]) - Set (or clear) an override key binding.
- SetOverrideBindingSpell(owner, isPriority, "KEY", "spellname") -
- SetOverrideBindingClick(owner, isPriority, "KEY", "ButtoName"[,"mouseButton"]) -
- SetOverrideBindingItem(owner, isPriority, "KEY", "itemname") -
- SetOverrideBindingMacro(owner, isPriority, "KEY", "macroname"|macroid) -
- ClearOverrideBindings(owner) - Reset all overrides belonging to an owner.
- SetMouselookOverrideBinding("KEY" [,"COMMAND"]) -
- IsModifierKeyDown() - equivalent to (IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown()).
- IsModifiedClick("action") - Returns 1 if the keys for the specified action are down, nil otherwise.
- IsMouseButtonDown([button or "button"]) -
Buff/Debuff Functions
Don't get buffId and buffIndex confused, they aren't the same thing!
- CancelPlayerBuff(id or "name"[,"rank"]) - Removes a specific buff from the player.
- CancelTrackingBuff() - Cancels your current tracking buff (Find Minerals etc.)
- GetPlayerBuff(buffId, buffFilter) - Retrieves info about a certain effect (beneficial, harmful or passive)
- GetPlayerBuffApplications(id or "name"[,"rank"]) - Retrieves the number of applications of a debuff or buff.
- GetPlayerBuffDispelType(id or "name"[,"rank"]) - Get the debuff type for a player debuff ("Magic", "Curse", "Disease", or "Poison")
- GetPlayerBuffName(id or "name"[,"rank"]) - Returns name, rank.
- GetPlayerBuffTexture(id or "name"[,"rank"]) - Retrieves the texture identifier for a certain buff
- GetPlayerBuffTimeLeft(buffIndex) - Retrieves how long a buff will last before expiring
- GetWeaponEnchantInfo() - Return information about main and offhand weapon enchantments.
- UnitBuff("unit", index [,raidFilter]) - Retrieves info about a buff of a certain unit.
- UnitDebuff("unit", index [,raidFilter]) - Retrieves info about a debuff of a certain unit.
Camera Functions
Mouse Look refers to holding down the right mouse button and controlling the movement direction. Shifting the view by holding down the left mouse button is not covered by these APIs.
- PROTECTED CameraOrSelectOrMoveStart() - Begin "Left click" in the 3D world. (1.10 - Protected)
- PROTECTED CameraOrSelectOrMoveStop([stickyFlag]) - End "Left click" in the 3D world. (1.10 - Protected)
- CameraZoomIn(increment) - Zooms the camera into the viewplane by increment.
- CameraZoomOut(increment) - Zooms the camera out of the viewplane by increment.
- FlipCameraYaw(degrees) - Rotates the camera about the Z-axis by the angle amount specified in degrees.
- IsMouselooking() - Returns 1 if mouselook is currently active, nil otherwise.
- MouselookStart()
- MouselookStop()
- MoveViewDownStart() - Begins rotating the camera downward.
- MoveViewDownStop() - Stops rotating the camera after MoveViewDownStart() is called.
- MoveViewInStart() - Begins zooming the camera in.
- MoveViewInStop() - Stops zooming the camera in after MoveViewInStart() is called.
- MoveViewLeftStart() - Begins rotating the camera to the Left.
- MoveViewLeftStop() - Stops rotating the camera after MoveViewLeftStart() is called.
- MoveViewOutStart() - Begins zooming the camera out.
- MoveViewOutStop() - Stops zooming the camera out after MoveViewOutStart() is called.
- MoveViewRightStart() - Begins rotating the camera to the Right.
- MoveViewRightStop() - Stops rotating the camera after MoveViewRightStart() is called.
- MoveViewUpStart() - Begins rotating the camera upward.
- MoveViewUpStop() - Stops rotating the camera after MoveViewUpStart() is called.
- PROTECTED PitchDownStart() - Begins pitching the camera Downward.
- PROTECTED PitchDownStop() - Stops pitching the camera after PitchDownStart() is called.
- PROTECTED PitchUpStart() - Begins pitching the camera Upward.
- PROTECTED PitchUpStop() - Stops pitching the camera after PitchUpStart() is called.
- NextView() - Cycles forward through the five predefined camera positions.
- PrevView() - Cycles backward through the five predefined camera positions.
- ResetView(index) - Resets the specified (1-5) predefined camera position to it's default if it was changed using SaveView(index).
- SaveView(index) - Replaces the specified (1-5) predefined camera positions with the current camera position.
- SetView(index) - Sets camera position to a specified (1-5) predefined camera position.
Channel Functions
These are chat functions which are specific to channels. Also see the Chat Window Functions and Communication Functions sections.
- AddChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel visible in a specific ChatFrame.
- ChannelBan("channel", "name") - Bans a player from the specified channel.
- ChannelInvite("channel", "name") - Invites the specified user to the channel.
- ChannelKick("channel", "name") - Kicks the specified user from the channel.
- ChannelModerate("channel") - Enables channel Moderation commands such as ChannelKick/Ban.
- ChannelModerator("channel", "name") - Sets the specified player as the channel moderator.
- ChannelMute("channel", "name") - Turns off the specified player's ability to speak in a channel.
- ChannelToggleAnnouncements("channel") - Toggles the channel to display announcements either on or off.
- ChannelUnban("channel", "name") - Unbans a player from a channel.
- ChannelUnmoderator("channel", "name") - Takes the specified user away from the moderator status.
- ChannelUnmute("channel", "name") - Unmutes the specified user from the channel.
- DisplayChannelOwner("channel") - Displays the owner of the specified channel in the default chat.
- EnumerateServerChannels() - Retrieves all available server channels (zone dependent).
- GetChannelList() - Retrieves joined channels.
- GetChannelName("channel" or index) - Retrieves the name from a specific channel.
- GetChatWindowChannels(index) - Get the chat channels received by a chat window.
- JoinChannelByName("channel"[, "password"[, frameId]]) - Join the specified chat channel (with optional password, and register for specified frame) (updated in 1.9)
- LeaveChannelByName("channel") - Leaves the channel with the specified name.
- ListChannelByName(channelMatch) - Lists members in the given channel to the chat window.
- ListChannels() - Lists all of the channels into the chat window.
- RemoveChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel invisible (hidden) in a specific ChatFrame.
- SendChatMessage("msg",[ "chatType",[ "language",[ "channel"]]]) - Sends a chat message.
- SetChannelOwner("channel", "name") - Sets the channel owner.
- SetChannelPassword("channel", "password") - Changes the password of the current channel.
Character Functions
- AbandonSkill(index) - The player abandons a skill.
- AcceptResurrect() - The player accepts the request from another player to resurrect him/herself.
- AcceptSkillUps()
- AcceptXPLoss() - Accept the durability loss to be reborn by a spirit healer (The name is a remnant from when sprit res was an XP loss instead).
- AddSkillUp(index)
- BuySkillTier(index)
- CancelSkillUps()
- CheckBinderDist() - Check whether the player is close enough to interact with the Hearthstone binder.
- ConfirmBinder() - Confirm the request to set the binding of the player's Hearthstone.
- DeclineResurrect() - Decline the request from another player to resurrect him/herself.
- GetBindLocation() - Get the name of the location for your Hearthstone.
- GetBlockChance() - Returns the player's percentage block chance.
- GetCombatRating() - Returns the player's combat rating for a particular combat rating. New as of TBC patch
- GetCombatRatingBonus() - Returns the player's combat rating bonus for a particular combat rating. New as of TBC patch
- GetComboPoints() - Get the current number of combo points.
- GetCorpseRecoveryDelay() - Time left before a player can accept a resurrection
- GetCritChance() - Returns the player's melee critical hit chance
- GetCurrentTitle() - Returns the player's current titleId
- GetDamageBonusStat() - returns index of which stat a player receives a damage bonus from increasing
- GetDodgeChance() - Returns the player's percentage dodge chance.
- GetManaRegen() - Returns the player's mana regeneration rates.
- GetMoney() - Returns an integer value of your held money in copper.
- GetNumTitles() - Returns the maximum titleId
- GetParryChance() - Returns the player's percentage parry chance.
- GetRangedCritChance() - Returns the players ranged critical strike chance.
- GetReleaseTimeRemaining() - Returns the amount of time left before your ghost is pulled from your body.
- GetResSicknessDuration()
- GetRestState()
- GetSpellBonusDamage(spellTreeID) - Returns the raw spell damage of the player for a given spell tree.
- GetSpellBonusHealing() - Returns the raw bonus healing of the player.
- GetSpellCritChance(school) - returns the players critical hit chance with a particular spell school.
- GetTimeToWellRested() - Defunct.
- GetTitleName(titleId) - Returns the player's current title name
- GetXPExhaustion() - Returns your character's current rested XP, nil if character is not rested.
- HasFullControl()
- HasSoulstone()
- IsFlying() - Returns 1 if flying, otherwise nil
- IsIndoors() - Returns 1 if you are indoors, otherwise nil. Returns nil for indoor areas where you can still mount.
- IsMounted() - Returns 1 if mounted, otherwise nil
- IsOutdoors() - Returns 1 if you are outdoors, otherwise nil. Returns 1 for indoor areas where you can still mount.
- IsResting()
- IsStealthed() - Returns 1 if stealthed or shadowmeld, otherwise nil
- IsSwimming() -
- IsTitleKnown(index) - Returns 1 if the title is valid for the player, otherwise 0.
- NotWhileDeadError() - Generates an error message saying you cannot do that while dead.
- RemoveSkillUp(index)
- ResurrectHasSickness() - Appears to be used when accepting a resurrection will give you resurrection sickessness.
- ResurrectHasTimer() - Does the player have to wait before accepting a resurrection
- RetrieveCorpse() - Resurrects when near corpse. e.g., The "Accept" button one sees after running back to your body.
- SetCurrentTitle(titleId) - Sets the player's current title id
- SetSelectedSkill(index)
- GetPVPDesired() - is the player permaflagged for PvP.
Chat Window Functions
These are functions which are specific to chat window management. Also see the Channel Functions and Communication Functions sections. (→ Mikk's spiel on chat windows)
- AddChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel visible in a specific ChatFrame.
- AddChatWindowMessages - Adds a messaging group to the specified chat window.
- ChangeChatColor(chatType,r,g,b) - Update the color for a type of chat message.
- UI ChatFrame_AddChannel(chatFrame, "channelName") - Activate channel in chatFrame.
- UI ChatFrame_AddMessageEventFilter("event", filterFunc) - Add a chat message filtering function (new in 2.4)
- UI ChatFrame_GetMessageEventFilters("event") - Retreive the list of chat message filtering functions. (new in 2.4)
- UI ChatFrame_OnHyperlinkShow(reference, link, button) - called when the user clicks on a chatlink.
- UI ChatFrame_RemoveMessageEventFilter("event", filterFunc) - Unregister a chat message filtering function (new in 2.4)
- GetChatTypeIndex(type) - Get the numeric ID of a type of chat message.
- GetChatWindowChannels(index) - Get the chat channels received by a chat window.
- GetChatWindowInfo(index) - Get setup information about a chat window.
- GetChatWindowMessages(index) - Get the chat message types received by a chat window.
- JoinChannelByName("channel"[, "password"[, frameId]]) - Join the specified chat channel (with optional password, and register for specified frame) (updated in 1.9)
- LoggingChat(newState) - Gets or sets whether logging chat to Logs\WoWChatLog.txt is enabled.
- LoggingCombat(newState) - Gets or sets whether logging combat to Logs\WoWCombatLog.txt is enabled.
- RemoveChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel invisible (hidden) in a specific ChatFrame.
- RemoveChatWindowMessages(chatFrameIndex,"messageGroup") - Remove a set of chat messages from this window.
- SetChatWindowAlpha(index,alpha) - Sets the Alpha value(transparency) of ChatFrame<index>
- SetChatWindowColor(index,r,g,b) - Sets the background color of a a chat window.
- SetChatWindowDocked(index,docked) - Set whether a chat window is docked.
- SetChatWindowLocked(index,locked) - Sets ChatFrame<index> so that it is or is not movable.
- SetChatWindowName(index,"name") - Sets the name of ChatFrame<index> to <"name">.
- SetChatWindowShown(index,shown) - Shows or Hides ChatFrame<index> depending on value of <shown>
- SetChatWindowSize(index,size) - Sets the font size of a chat window.
Commentator Functions
These functions are all protected. Presumably used for watching Arena matches.
- CommentatorAddPlayer(teamNumber)
- CommentatorEnterInstance()
- CommentatorExitInstance()
- CommentatorFollowPlayer(factionIndex,playerIndex)
- CommentatorGetCamera()
- CommentatorGetCurrentMapID()
- CommentatorGetInstanceInfo()
- CommentatorGetMapInfo(mapIndex)
- CommentatorGetMapInfo(mapIndex,instanceIndex)
- CommentatorGetMode()
- CommentatorGetNumMaps()
- CommentatorGetNumPlayers(faction)
- CommentatorGetPlayerInfo(factionIndex,playerIndex)
- CommentatorLookatPlayer(factionIndex,playerIndex)
- CommentatorRemovePlayer()
- CommentatorSetBattlemaster()
- CommentatorSetCamera()
- CommentatorSetCameraCollision(bool enable)
- CommentatorSetMapAndInstanceIndex(mapIndex,instanceIndex)
- CommentatorSetMode()
- CommentatorSetMoveSpeed(speed)
- CommentatorSetPlayerIndex(factionIndex,playerIndex)
- CommentatorSetTargetHeightOffset(float offset)
- CommentatorStartInstance(mapID,teamsize,minLevel,maxLevel)
- CommentatorToggleMode()
- CommentatorUpdateMapInfo()
- CommentatorUpdatePlayerInfo()
- CommentatorZoomIn()
- CommentatorZoomOut()
Communication Functions
These are the functions which communicate with other players. Also see the Channel Functions and Chat Window Functions sections.
- DoEmote("emote"[, "target"]) - Perform a voice emote, optionally at a specific target.
- GetDefaultLanguage("unit") - Returns the default language that the unit is speaking after logon.
- GetLanguageByIndex(index) - Returns the language specified by the index.
- GetNumLanguages() - Returns the number of languages your character can speak (Renamed in 2.4, formerly mistyped GetNumLaguages).
- RandomRoll(low, high) - Does a random roll between the two values.
- SendAddonMessage("prefix", "text", "type" [, "player"]) - Sends a message to hidden AddOn channels. - Added in 1.12
- SendChatMessage("msg",[ "chatType",[ "language",[ "channel"]]]) - Sends a chat message.
Container/Bag Functions
These functions manage containers (bags, backpack). See also Inventory Functions and Bank Functions.
- ContainerIDToInventoryID(bagID)
- GetBagName(bagID) - Get the name of one of the player's bags.
- GetContainerItemCooldown(bagID, slot)
- GetContainerItemInfo(bagID, slot) - Get the info for an item in one of the player's bags.
- GetContainerItemLink(bagID, slot) - Returns the itemLink of the item located in bag#, slot#.
- GetContainerNumSlots(bagID) - Returns the total number of slots in the bag specified by the index.
- GetContainerNumFreeSlots(bagID) - Returns the number of free slots and type of slots in the bag specified by the index. (New in Patch 2.4)
- HasKey() - Returns 1 if the player has a keyring, nil otherwise.
- UI OpenAllBags() - Open all bags
- UI CloseAllBags() - Close all bags
- PickupBagFromSlot(slot) - Picks up the bag from the specified slot, placing it in the cursor. If an item is already picked up, this places the item into the specified slot, swapping the items if needed.
- PickupContainerItem(bagID,slot)
- PutItemInBackpack() - attempts to place item in backpack (bag slot 0).
- PutItemInBag(inventoryId) - attempts to place item in a specific bag.
- UI PutKeyInKeyRing() - attempts to place item in your keyring.
- SetBagPortaitTexture(texture,slot)
- SplitContainerItem(bagID,slot,amount)
- UI ToggleBackpack() - Toggles your backpack open/closed.
- UI ToggleBag(bagID) - Opens or closes the specified bag.
- PROTECTED (Situational) UseContainerItem(bagID, slot[, onSelf]) - Uses an item located in bag# and slot#. (Warning: If a vendor window is open, using items in your pack may sell them!) - 'onSelf' added in 1.12
Crafting Functions
These are now used only for the enchanting and the hunters train-pet-window (for the other skills see TradeSkill Functions). Most functions only work if the window for enchants is opened in the GUI. You can check whether the window is opened by using GetCraftSkillLine().
- CloseCraft()
- CollapseCraftSkillLine(index)
- CraftIsPetTraining() - Determine if the current 'crafting' skill is the pet training one. (New in 2.2.0)
- DoCraft(index)
- ExpandCraftSkillLine(index)
- GetCraftButtonToken()
- GetCraftCooldown(index) - Returns the number of seconds left for a skill to cooldown.
- GetCraftDescription(index)
- GetCraftDisplaySkillLine()
- GetCraftIcon(index)
- GetCraftInfo(index)
- GetCraftItemLink(index) - Returns an itemLink for the specified craftable item.
- GetCraftName()
- GetCraftNumReagents(index)
- GetCraftReagentInfo(index,reagentIndex)
- GetCraftReagentItemLink(index,reagentIndex) - Returns an itemLink for one of the reagents needed to craft the given item
- GetCraftRecipeLink(index) - Returns an EnchantLink for the specified craft.
- GetCraftSelectionIndex()
- GetCraftSkillLine()
- GetCraftSpellFocus(index) - ?.
- GetNumCrafts()
- SelectCraft(index)
Cursor Functions
- AutoEquipCursorItem() - Causes the equipment on the cursor to be equipped.
- ClearCursor() - Clears whatever item the cursor is dragging from the cursor. - Added in 1.12
- CursorCanGoInSlot(invSlot) - Return true if the item currently held by the cursor can go into the given inventory (equipment) slot
- CursorHasItem() - Returns true if the cursor currently holds an item
- CursorHasMoney() - true/false
- CursorHasSpell() - true/false
- DeleteCursorItem()
- DropCursorMoney - Drops the amount of money held by the cursor.
- DropItemOnUnit("unit") - Drops an item from the cursor onto a unit.
- EquipCursorItem(invSlot)
- GetCursorInfo() - Returns information about what the cursor is holding
- GetCursorMoney - Returns the amount of money held by the cursor.
- GetCursorPosition() - Returns the cursor's position on the screen.
- HideRepairCursor()
- InRepairMode() - Returns true if your cursor is in repair mode
- PickupAction(slot) - Drags an action out of the specified quickbar slot and holds it on the cursor.
- PickupBagFromSlot(slot) - Picks up the bag from the specified slot, placing it in the cursor. If an item is already picked up, this places the item into the specified slot, swapping the items if needed.
- PickupContainerItem(bagID,slot)
- PickupInventoryItem(invSlot) - "Picks up" an item from the player's worn inventory.
- PickupItem(itemID or "item") - New in 2.3.
- PickupMacro(index) - Pickup a macro button icon.
- PickupMerchantItem(index) - Places the item on the cursor. If the cursor already has an item, the item in the cursor will be sold.
- PickupPetAction(slot) - Drags an action from the specified pet action bar slot into the cursor.
- PickupPlayerMoney - Picks up an amount of money from the player.
- PickupSpell(spellID, "bookType") - Loads an action button onto the cursor to be dropped into a quickbar slot.
- PickupStablePet(index) - ?.
- PickupTradeMoney(amount)
- PlaceAction(slot) - Drops an action from the cursor into the specified quickbar slot.
- PutItemInBackpack() - attempts to place item in backpack (bag slot 0).
- PutItemInBag(inventoryId) - attempts to place item in a specific bag.
- ResetCursor()
- SetCursor("cursor" or nil)
- ShowContainerSellCursor(index,slot)
- ShowInspectCursor() - Change the cursor to the magnifying glass inventory inspection cursor
- ShowInventorySellCursor() - ?.
- ShowMerchantSellCursor(index) - Changes the cursor to the merchant sell cursor.
- ShowRepairCursor()
- SplitContainerItem(bagID,slot,amount) - Picks up part of a stack.
Debugging Functions
- debugprofilestart() - starts a timer for profiling during debugging.
- debugprofilestop() - return the time in milliseconds since the last call to debugprofilestart()
- FrameXML_Debug(flag) - Sets FrameXML logging state which is output to /WoW Folder/Logs/FrameXML.log
- GetDebugStats()
- debugstack(start, count1, count2) - Returns a string representation of the current calling stack (as of 1.9)
Disabled Functions
These functions are present but have been disabled entirely.
- AppendToFile - ?.
- DeleteFile() - ?
- ReadFile() - ?.
Dressing Room Functions
Functions Controlling the Dressing Room interface. NEW in 1700.
- UI DressUpItem(itemId) - Will show the DressingRoom UI with the given item ID equipped.
- UI DressUpItemLink("itemString" or "itemLink") - Will show the DressingRoom UI with the given item equipped.
- UI SetDressUpBackground(isAuctionFrame) - Given an Item shown in the Auction House will show the DressingRoom UI with the item equipped.
Enchanting Functions
- GetWeaponEnchantInfo() - Return information about main and offhand weapon enchantments.
- ReplaceEnchant()
- ReplaceTradeEnchant() - Confirm the replacement of an enchantment via trade.
- BindEnchant() - Confirm the binding of the item when enchanting.
Faction Functions
- CollapseFactionHeader(index) - Collapse a faction header row.
- ExpandFactionHeader(index) - Expand a faction header row.
- FactionToggleAtWar(index) - Toggle the At War flag for a faction.
- GetFactionInfo(index) - Gets details for a specific faction/faction header.
- GetNumFactions() - Returns the number of lines in the faction display.
- GetSelectedFaction() - Returns the row index of the currently selected faction in reputation window. (New in 1.10)
- GetWatchedFactionInfo() - Returns information about the currently watched faction. (New in 1.10)
- IsFactionInactive(index) - Returns true if the faction is marked inactive. (New in 1.10)
- SetFactionActive(index) - Remove a faction from inactive group. (New in 1.10)
- SetFactionInactive(index) - Move a faction to inactive group. (New in 1.10)
- SetSelectedFaction(index) - Sets the currently selected faction in reputation window. (New in 1.10)
- SetWatchedFactionIndex(index) - Sets which faction should be watched in Blizzard reputation bar. (New in 1.10)
- UnitFactionGroup("unit") - Returns the faction group id and name of the specified unit. (eg. "Alliance") - string returned is localization-independent (used in filepath)
Frame Management
- CreateFrame("frameType"[ ,"name"][, parent][, "inheritFrame"]) - Create a new frame of the specified type
- CreateFont("name") - Dynamically create a font object
- GetFramesRegisteredForEvent(event) - Returns a list of frames that are registered for the given event. - Added in 2.3
- GetNumFrames() - Get the current number of Frame (and derivative) objects
- EnumerateFrames(currentFrame) - Get the Frame which follows currentFrame
- GetMouseFocus() - Returns the frame that currently has the mouse focus.
- UI MouseIsOver - Determines whether or not the mouse is over the specified frame.
- PetActionBarFrame:Show(), :Hide() - Shows or hides the Pet Actionbar Frame for players with pets. (Workaround for the petbar issue)
- UI ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset)
- UI UIFrameFadeIn(frame, fadeTime, startAlpha, endAlpha)
- UI UIFrameFlash(...)
Friend Functions
- AddFriend("playerName") - Add a friend to your friend list.
- GetFriendInfo(index) - Returns name, level, class, location, connected, status, and friend note of a friend.
- SetFriendNotes(index, noteText) - Sets the note text for a friend.
- GetNumFriends() - Returns how many friends are on your friend list.
- GetSelectedFriend() - Returns the index of the current selected friend.
- RemoveFriend("name" or index) - Removes a friend from your friend list
- SetSelectedFriend(index) - Update the current selected friend.
- ShowFriends() - Request updated friends information from server.
- UI ToggleFriendsFrame([tabNumber]) - Opens/closes the friends pane (possibly on a specific tab).
GM Functions
- CanComplainChat(lineID) - determines if we should show the menu for reporting a line of chat spam (lineID comes from the player link in the chat line)
- CanComplainInboxItem(index) - determines if we should show the “report spam” button on a mail item
- ComplainChat(lineID) - complains about a particular line of chat spam
- ComplainInboxItem(index) - complains about a particular mail item
- PROTECTED DeleteGMTicket()
- GMRequestPlayerInfo() - access denied (darn)
- GetGMStatus()
- GetGMTicket()
- GetGMTicketCategories() - Return all available ticket categories (not as a table)
- GMSurveyAnswerSubmit(question, rank, comment) - ?
- GMSurveyCommentSubmit(comment) - ?
- GMSurveyQuestion ?
- GMSurveySubmit ?
- PROTECTED NewGMTicket(type,"text")
- PROTECTED Stuck() - Informs the game engine that the player is Stuck.
- PROTECTED UpdateGMTicket(type,"text")
Gossip Functions
- CloseGossip() - Dismiss the gossip window.
- GetGossipActiveQuests() - Retrieves a list of the active (?) quests on the NPC you are talking to.
- GetGossipAvailableQuests() - Retrieves a list of the available (!) quests on the NPC you are talking to.
- GetGossipOptions() - Retrieves a list of the available gossip items on the NPC you are talking to.
- GetGossipText() - Retrieves the gossip text.
- SelectGossipActiveQuest(index) - Selects an active quest.
- SelectGossipAvailableQuest(index) - Selects an available quest.
- SelectGossipOption(index) - Selects on a gossip item.
Group Functions
See also: Raid Functions
- AcceptGroup() - Accept the invitation to party.
- CheckReadyCheckTime() - Unknown, called from UIParent's OnUpdate!
- ConfirmReadyCheck(isReady) - Indicate if you are ready or not.
- ConvertToRaid() - Converts party to raid.
- DeclineGroup() - Decline the invitation to a party.
- DoReadyCheck() - Initiate a ready check.
- GetLookingForGroup()
- GetLootMethod() - Return the currently active lootMethod
- GetLootThreshold() - Return the current loot threshold (for group/master loot)
- GetMasterLootCandidate(index) - Return the name of a player who is eligible to receive loot in master mode
- GetNumPartyMembers() - Returns the number of party members
- GetPartyLeaderIndex() - Returns the index of the party leader (1-4) if not yourself.
- GetPartyMember(index) - Returns 1 if the party member at the given index exists, nil otherwise..
- InviteUnit("name" or "unit") - Invites the specified player to the group you are currently in (new for WoW 2.0)
- IsPartyLeader() - Returns true if the player is the party leader.
- LeaveParty() - Quit the party
- PromoteByName("name") - Promotes by name the target.
- PromoteToLeader("unit") - Promote a unit to party leader.
- SetLootMethod("lootMethod"[, "masterPlayer" or threshold]) - Set the current loot method
- SetLootThreshold(itemQuality) - Set the threshold for group/master loot
- UninviteUnit("unit" or "name") - Kick a unit from the party if player is group leader.
- UnitInParty("unit") - Returns true if the unit is a member of your party.
- UnitIsPartyLeader("unit") - Returns true if the unit is the leader of its party.
Guild Functions
- AcceptGuild() - The player accepts the invitation to join a guild.
- BuyGuildCharter("guildName") - Purchases a guild charter for guildName.
- CanEditGuildInfo() - Returns true if you are allowed to edit the guild info
- CanEditMOTD() - Returns true if you are allowed to edit the guild motd.
- CanEditOfficerNote() - Returns true if you are allowed to edit a guild member's officer note.
- CanEditPublicNote() - Returns true if you are allowed to edit a guild member's public note.
- CanGuildDemote() - Returns true if you are allowed to demote a guild member.
- CanGuildInvite() - Returns true if you are allowed to invite a new