WoW API < JoinBattlefield

Queues the player, or the player's group, for a battlefield instance.

JoinBattlefield(index[, asGroup[, isRated]])

Arguments Edit

Number - Which battlefield instance to queue for (0 for first available), or which arena bracket to queue for.
Boolean - If true-equivalent, the player's group is queued for the battlefield, otherwise, only the player is queued.
Boolean - If true-equivalent, and queueing for an arena bracket, the group is queued for a rated match as opposed to a skirmish.

Details Edit

The function requests the player to be added to a queue for a particular instance of the currently selected battleground type, as set by RequestBattlegroundInstanceInfo(index). You CANNOT queue immediately after a RequestBattlegroundInstanceInfo call, and must instead capture the event that indicates that the instance list is available.

Example Edit

The following code creates a utility function, JoinBattlegroundType, which allows you to queue for the first available instance of a specific battleground type.

 local f, aG, iR = CreateFrame("FRAME");
 f:SetScript("OnEvent", function(self, event)
  JoinBattlefield(0, aG, iR);
 function JoinBattlegroundType(index, asGroup, isRated)
  if f:IsEventRegistered("PVPQUEUE_ANYWHERE_SHOW") then
   error("A join battleground request is already being processed");
  aG, iR = asGroup, isRated;

The following will queue you for Skirmish 2v2 if not in a group.

/script JoinBattlefield(1)

Notes Edit

  • When the Arena Battlemaster window is open, index 1 is 2vs2, index 2 is 3vs3 and index 3 is 5vs5.

See Also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.