Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API AcceptBattlefieldPort

From WoW Classic Wiki
AcceptBattlefieldPort() - Documentation by weab

Confirms entry into a Battleground you are queued for that is ready.

AcceptBattlefieldPort(index, accept)

Parameters

Arguments

index
Numeric - The battlefield in queue to enter.
accept
Boolean - Whether or not to accept entry to the battlefield.

Details

Passing nil as an accept argument will cause you to leave the queue for the battlefield, if you are inside a battlefield you will leave it regardless if it's ended or not.

Example

If the following code is called when the UPDATE_BATTLEFIELD_STATUS event is fired, it will automatically join a battleground when it becomes available.

for i=1, MAX_BATTLEFIELD_QUEUES do
	status, mapName, instanceID = GetBattlefieldStatus(i)
	if status == "confirm" then
		AcceptBattlefieldPort(i,1)
		StaticPopup_Hide("CONFIRM_BATTLEFIELD_ENTRY")
	end
end