World of Warcraft API
From WoWWiki
| Main Menu |
|---|
|
|
The World of Warcraft API, or WoW API, is a set of functions provided by Blizzard which enables 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.
Achievement Functions
These functions are only available in Patch 3.0.
- CanShowAchievementUI() - Returns if the AchievementUI can be displayed
- ClearAchievementComparisonUnit() - Remove the unit being compared.
- GetAchievementCategory(achievementID) - Return the category number the requested achievement belongs to.
- GetAchievementComparisonInfo(achievementID, comparisonNum) - Return the status of the achievement for the comparison player.
- GetAchievementCriteriaInfo(achievementID, criteriaNum) - Return information about the requested criteria.
- GetAchievementInfo((achievementID) or (category, offset) - Return information about the requested Achievement.
- GetAchievementInfoFromCriteria(id) - Return information about the requested Achievement.
- GetAchievementLink(achievementID) - Returns a link for the specified Achievement.
- GetAchievementNumCriteria(achievementID) - Return the number of criteria the requested Achievement has.
- GetCategoryInfo(category) - Return information about the requested category
- GetCategoryList() - Returns the list of Achievement categories.
- GetCategoryNumAchievements(category) - Return the number of Achievements, and number completed for the specific category.
- GetComparisonAchievementPoints() - Return the total number of achievement points the comparison unit has earned.
- GetComparisonStatistic(achievementID) - Return the value of the requested statistic for the comparison player.
- GetCriteriaComparisonInfo(achievementID, criteriaNum, comparisonIndex) - Return information about the requested criteria for the comparison unit.
- GetLatestCompletedAchievements() - Return the ID's of the last 5 completed Achievements.
- GetLatestUpdatedStats() - Return the ID's of the last 5 updated Statistics.
- GetNumCompletedAchievements() - Return the total number of Achievements, and number completed.
- GetPreviousAchievement(achievementID) - Return previous related achievements.
- GetStatistic(achievementID) - Return the value of the requested statistic.
- GetStatisticsCategoryList() - Returns the list of Statistic categories.
- GetTotalAchievementPoints() - Return the total number of achievement points earned.
- GetTrackedAchievement() - Return the AchievementID of the currently tracked achievement.
- SetTrackedAchievment(achievementId) - Set the Achievement to be tracked.
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.
- SetPVP(arg1) - Sets the players PVP mode (1 to enable, nil to toggle off eventually)
- 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]) - Returns details about an auction item on which the user is bidding (possibly out-dated by GetAuctionItemInfo("bidder", item))
- GetNumAuctionItems("type") - Returns the size of the specified auction item list.
- GetOwnerAuctionItems([page]) - Returns details about an auction item of which the user is the owner (possibly out-dated by GetAuctionItemInfo("owner", item))
- 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) - Performs a search of the auction house with the specified characteristics.
- 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.
Barber Shop Functions
These functions were introduced in Patch 3.0.2.
- GetBarberShopStyleInfo()
- SetNextBarberShopStyle()
- GetBarberShopTotalCost() - Returns the total costs of the cosmetic changes.
- ApplyBarberShopStyle() - Purchase and apply the cosmetic changes.
- CancelBarberShop() - Exit the Barber Shop chair.
- GetHairCustomization()
- GetFacialHairCustomization()
- BarberShopReset() - Reset any changes made in the Barber Shop
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", "buttonName" [, "mouseClick"]) - Sets an override binding that acts like a mouse click on a button.
- 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!
- REMOVED CancelPlayerBuff(id or "name"[,"rank"]) - Removes a specific buff from the player. (Replaced in 3.0 with CancelUnitBuff)
- CancelTrackingBuff() - Cancels your current tracking buff (Find Minerals etc.)
- CancelUnitBuff("unit", index or "spell" [,"filter" or "rank"]) - Removes a specific buff from the player.
- 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")
- REMOVED 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 or buffName [,raidFilter]) - Retrieves info about a buff of a certain unit.
- UnitDebuff("unit", index or buffName [,raidFilter]) - Retrieves info about a debuff of a certain unit.
Calendar Functions
Calendar functions from Wrath of the Lich King (Beta)
- CalendarAddEvent()
- CalendarCloseEvent()
- CalendarContextEventCanComplain(monthOffset, day, eventIndex)
- CalendarContextCanEdit(monthOffset, day, eventIndex)
- CalendarContextEventClipboard()
- CalendarContextEventComplain(monthOffset, day, eventIndex)
- CalendarContextEventCopy(monthOffset, day, eventIndex)
- CalendarContextEventIsGuildWide(monthOffset, day, eventIndex)
- CalendarContextInviteAvailable(monthOffset, day, eventIndex)
- CalendarContextInviteDecline(monthOffset, day, eventIndex)
- CalendarContextInviteRemove(monthOffset, day, eventIndex)
- CalendarContextEventPaste(monthOffset, day)
- CalendarContextEventRemove(monthOffset, day, eventIndex)
- CalendarContextInviteStatus(monthOffset, day, eventIndex)
- CalendarEventSetDate(month, day, year)
- CalendarEventSetDescription(description)
- CalendarEventSetModerator(index)
- CalendarEventSetRepeatOption(repeatoption)
- CalendarEventSetStatus(index, status) - Sets the invitation status of a player to the current event
- CalendarEventSetTime(hour, minute)
- CalendarEventSetTitle(title)
- CalendarEventSetType(type)
- CanSendInvite() - Returns true or false for if player can invite players to current event
- CalendarGetDate()
- CalendarGetDay(monthOffset[, day])
- CalendarGetDayEvent(monthOffset, day, eventIndex)
- CalendarGetEventInfo() - Returns detailed information about an event selected with CalendarOpenEvent()
- CalendarGetHolidayInfo(monthOffset, day, eventIndex)
- CalendarGetMonth([monthOffset])
- CalendarGetNumDayEvents(monthOffset[, day])
- CalendarEventGetInvite(inviteeIndex) - Returns status information for an invitee for the event opened with CalendarOpenEvent().
- CalendarEventGetNumInvites() - Returns the number of invitees for the event opened with CalendarOpenEvent().
- CalendarEventInvite("Player") - Invite player to currently selected event
- CalendarNewEvent() - Creates a new Event
- CalendarNewGuildWideEvent() - Creates a new GuildAnnouncement
- CalendarOpenEvent(monthOffset, day, eventIndex) - Establishes an event you'll be working with in later calls.
- CalendarUpdateEvent() - Use to update an existing event after making changes.
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()
- GetRuneCooldown(id) - Returns cooldown information about a given rune.
- GetRuneType(id) - Returns the type of rune with the given id.
- 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.
These functions get applied after reload ui (index 1 is General and index 2 is Combat Log):
- SetChatWindowAlpha(index,alpha) - Sets the Alpha value(transparency) of ChatFrame<index> (alpha - 0-100)
- SetChatWindowColor(index,r,g,b) - Sets the background color of a a chat window. (r/g/b - 0-255)
- SetChatWindowDocked(index,docked) - Set whether a chat window is docked. (docked - 0/1)
- SetChatWindowLocked(index,locked) - Sets ChatFrame<index> so that it is or is not movable. (locked - 0/1)
- SetChatWindowName(index,"name") - Sets the name of ChatFrame<index> to <"name">.
- SetChatWindowShown(index,shown) - Shows or Hides ChatFrame<index> depending on value of <shown> (shown - 0/1)
- SetChatWindowSize(index,size) - Sets the font size of a chat window. (size - default 14)
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") - Perform a voice emote.
- 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.
Companion Functions
These are functions which are used to the companion system (mini-pets and mounts).
- CallCompanion(TypeID, slotid) - Summons the specified companion. (New in Patch 3.0)
- GetCompanionInfo(TypeID, slotid) - Returns info about a selected companion. (New in Patch 3.0)
- GetNumCompanions(TypeID) - Get the number of companions of the specified type. (New in Patch 3.0)
- PickupCompanion(TypeID, index) - Picks up the indexed companion onto your mouse cursor. (New in Patch 3.0)
- PlayerModel:SetCreature(creatureID) - (New in Patch 3.0)
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().
In Patch 3.0, these are removed - use GetTradeSkill APIs instead.
- 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()
- Drop