WoW:API AcceptBattlefieldPort: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Typing wiki entries at 2 AM is bad I guess.)
(conformist layout)
Line 1: Line 1:
<center>'''AcceptBattlefieldPort()''' - ''Documentation by weab''</center>
{{wowapi}}__NOTOC__
 
Confirms entry into a Battleground you are queued for that is ready.
Confirms entry into a Battleground you are queued for that is ready.
AcceptBattlefieldPort(index, accept)


AcceptBattlefieldPort(index, accept)
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:;index : Numeric - The battlefield in queue to enter.
:;index : Numeric - The battlefield in queue to enter.
:;accept : Boolean - Whether or not to accept entry to the battlefield.
:;accept : Boolean - Whether or not to accept entry to the battlefield.
Line 13: Line 11:
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.
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 ===
== 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
  for i=1, MAX_BATTLEFIELD_QUEUES do
  status, mapName, instanceID = GetBattlefieldStatus(i)
  status, mapName, instanceID = GetBattlefieldStatus(i)
Line 24: Line 19:
  end
  end
  end
  end
 
===Result===
 
If the following code is called when the UPDATE_BATTLEFIELD_STATUS event is fired, it will automatically join a battleground when it becomes available.
----
__NOTOC__
{{wowapi}}

Revision as of 10:14, 24 December 2006

WoW API < AcceptBattlefieldPort

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

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

Result

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