WoW API: JoinBattlefield
Queues the player, or the players group for a battlefield.
JoinBattlefield(index, joinAs, isRated)
Parameters
Arguments
- index, joinAs, isRated
- index
- Integer - Which battlefield instance to queue for (0 for first available), or which arena bracket to queue for
- joinAs
- Integer - Queue as a group
- isRated
- Integer - Queues for a rated arena
Details
Queues the player for the current battlefield they have open. When the Arena Battlemaster window is open, index 1 is 2vs2, index 2 is 3vs3 and index 3 is 5vs5, if you pass the "isRated" flag it'll queue for a rated arena, if you don't it'll queue for a Skirmish arena.
Patch 2.0.3 You can no longer queue a group for Alterac Valley, and if the battlefield window is closed it won't queue you for the last opened battlefield. Because of this, it's possible to do send a JoinBattlefield request and then not be queued if you jump away too quickly and close the window.
Patch 2.4.0 Queuing for Alterac Valley as a group is back
Example
Queue the players group for the battlefield window open.
if( CanJoinBattlefieldAsGroup() ) then -- Queue as a group for the first available battleground JoinBattlefield(0, 1); else -- Solo queue for the first available battleground JoinBattlefield(0); end
Queue the players group for a rated 3vs3 arena.
JoinBattlefield(2, 1, 1);