Functions Info

From WoWDev

These are a set of functions, provided by Blizzard, that allow one 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 may utilise 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.

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. Look under the hood.


Data and Argument Types

The API uses special values for some function arguments, the commonly used types are:

AuctionSortId - An identifier for sorting columns in the auction house.
AuctionTypeId - An identifier specifying which type of auction to operate on.
ChatTypeId - An identifier for the different chat destination types.
InventorySlotName - Names of inventory slots.
LootRuleId - An identifier for the different looting rule types.
PlayerName - The name of a player.
StandingId - Numeric encoding of faction standing.
UnitId - An identifier which specifies one of the units the API may reference.

Notation and Conventions

The function names on this page also include usage information (where known), the convention for argument lists is derived from the World of Warcraft Usage format, with a slight change to make them Wiki link friendly. It's probably easiest to show the conventions by example:

SetMapZoom(continentIndex{,zoneIndex}) - Sets the current world map to a specific continent and optionally zone.

This function takes up to two arguments, the curly braces indicate that the second argument is optional (The standard format is to use square brackets, but these interfere with the Wiki link, so if including the function arguments in a link description we use curly braces).

TargetUnit("unit") - Selects the specified id as the current target.

The quotes around the unit argument on this function indicates that the parameter is a string. It does not mean that the argument is always (and in many cases, ever) the literal value "unit".

FrameLayout:GetHeight() - Returns the height of the frame layout object.

This example shows that the GetHeight() function is called as a method function on a FrameLayout object (and that it takes no arguments).

When adding new entries to this page, please follow this convention for consistency, since the actual page names are the word API followed by a space and the function name (with no argument information), links are written as follows:

: [[API SetMapZoom|SetMapZoom(continentIndex{,zoneIndex})]]

For object methods, the name includes the object type:

: [[API FrameLayout GetHeight|FrameLayout:GetHeight()]]

Finally, there are a couple of prefixes which can appear before a link. REMOVED indicates that the function has been removed from the API. UI indicates that the function is provided by the FrameXML UI code, rather than the core API.