Random BG (queue) Macro

UI and Macro
I found above code does not workin.

here is my new "queue Capture the Flag game" macro using RequestBattlegroundInstanceInfo(). first line "Horde Battle Standard" is just for Horde :)
#show Horde Battle Standard
/run local j=0 for i=1,GetNumBattlegroundTypes() do local n,ok=GetBattlegroundInfo(i); if ok and (n=="Warsong Gulch" or n=="Twin Peaks") then RequestBattlegroundInstanceInfo(i); JoinBattlefield(j); j=j+1 end end

if you want to use battlefield ID to against number of characters,
/run local j=0 for i=1,GetNumBattlegroundTypes() do local n,ok,_,_,id=GetBattlegroundInfo(i); if ok and (id==2 or id==108) then RequestBattlegroundInstanceInfo(i); JoinBattlefield(j); j=j+1 end end
Battlefield ID sheet
# Name ID
1 Random Battleground 32
2 Twin Peaks 108
3 The Battle for Gilneas 120
4 Warsong Gulch 2
5 Arathi Basin 3
6 Eye of the Storm 7
7 Alterac Valley 1
8 Strand of the Ancients 9
9 Isle of Conquest 30
With the original macro posted it doesn't queue when I get out of a BG I've just done.. What on earth would be causing this?
07/07/2012 07:40 AMPosted by Iunix
With the original macro posted it doesn't queue when I get out of a BG I've just done.. What on earth would be causing this?


It's not designed for it. All that macro does is drop you out of the BG queue and dungeon queue and queues you up for a random battleground.

This was needed at the time because there was a problem in early cata with the BG queue system where you could be stuck in queue for hours because the server never acknowledged you were in queue.

This is why you check post dates before you post (you can fine those right above the quote and reply buttons)

Use this macro instead:
/run for i=1,GetNumBattlegroundTypes()do local _,_,_,iR,_=GetBattlegroundInfo(i)if iR then JoinBattlefield(i)end end


This works great for whichever BG in the PvP page is selected, is it possible to queue two as Choonster requested? I too would like to queue both WSG and Arathi with one button press, regardless which BG is already queued? Two separate buttons would be a fine alternative.

/run for i=1,GetNumBattlegroundTypes()do local _,_,_,_,BGID=GetBattlegroundInfo(i)function JB(I)JoinBattlefield(BGID==I and i)end JB(1)JB(2)end

Did not work at all. Thanks
Hey guys,

I've got a slight issue with the Warsong Gulch queue. it doesn't work after I've exited a battleground for some reason?
Here's the Macro code I used.

/run for i=1,GetNumBattlegroundTypes()do local name,_,_,_,_=GetBattlegroundInfo(i)if name=="Warsong Gulch"then JoinBattlefield(i)end end

Is there anything wrong with that that disables the macro to be used after I've left the battleground? Any info would be great. Cheers :)
Hey so I am using this macro and it works once but then once I try to re que it doesn't work again. Help please?
That's my issue aswell
/run TogglePVPFrame()for i=1,GetNumBattlegroundTypes()do local _,_,_,iR,_=GetBattlegroundInfo(i)if iR then JoinBattlefield(i)end end TogglePVPFrame()


This is the macro I use. It will queue you for the bg highlighted in the pvp frame, and works every time.
Hey, is there a way to make a script so when the BG is OVER, I can leave?? I am having issues leaving the battleground at the end using the macros above. When used, I get booted and placed with deserter. Plz help

local myEventFrame, MyEvents = CreateFrame("Frame"), {};
local ag = false
local BGIndex = 0
local RandomQueue = false
local SpecificQueue = false

function MyEvents:PVPQUEUE_ANYWHERE_SHOW(...)
--print(string.format("BGIndex: %d",BGIndex))
local Index = BGIndex - 1
--print(string.format("BGIndex: %d | Index: %d",BGIndex,Index))
JoinBattlefield(Index, ag)
self:UnregisterEvent("PVPQUEUE_ANYWHERE_SHOW")
end

function QueueBgs(AsTeam, Random)
local MAX_BATTLEFIELD_QUEUES = 2
local WarsongGulch = false
local ArathiBasin = false
local RandomBG = false

if Random == true then
RandomQueue = true
SpecificQueue = false
else
RandomQueue = false
SpecificQueue = true
end

local i = 0
while i <= MAX_BATTLEFIELD_QUEUES do
local Status,BG = GetBattlefieldStatus(i)
--if Status ~= nil and BG ~= nil then
-- print(string.format("Status: %s | BG: %s | Index: %d",Status,BG,i))
--end

if BG == "Warsong Gulch" and Status == "queued" then
WarsongGulch = true
elseif BG == "Arathi Basin" and Status == "queued" then
ArathiBasin = true
end
i = i + 1
end

local Index = 1

while Index <= GetNumBattlegroundTypes() do

local Name, CanEnter, IsHoliday, IsRandom, BGID = GetBattlegroundInfo(Index)

local Holiday = "False"
local Random = "False"
local Entry = "False"

if IsHoliday == true then
Holiday = "True"
end
if IsRandom == true then
Random = "True"
end
if CanEnter == true then
Entry = "True"
end

--print(string.format("[%d]Name: %s | Entry: %s | Bonus: %s | Random: %s",Index,Name,Entry,Holiday,Random))

if CanEnter == true then
if SpecificQueue == true then
if Name == "Warsong Gulch" and WarsongGulch == false then
JoinBattlegroundType(Index,AsTeam)
break
elseif Name == "Arathi Basin" and ArathiBasin == false then
JoinBattlegroundType(Index,AsTeam)
break
end
elseif RandomQueue == true then
JoinBattlefield(32,AsTeam)
break
end
end

Index = Index + 1
end
end

function JoinBattlegroundType(index, asGroup)
--if myEventFrame:IsEventRegistered("PVPQUEUE_ANYWHERE_SHOW") then
-- error("A join battleground request is already being processed.")
--end

myEventFrame:RegisterEvent("PVPQUEUE_ANYWHERE_SHOW")

BGIndex = index
aG = asGroup
RequestBattlegroundInstanceInfo(BGIndex)
end


Then..

Queue as Random-Solo
QueueBgs(false,true)

Queue as Random-Group
QueueBgs(true,true)

Queue as Specific-Solo
QueueBgs(false,false)

Queue as Specific-Group
QueueBgs(true,false)

AutoQueue:

local f = CreateFrame("Frame");
f:SetScript("OnUpdate", function(self, sinceLastUpdate) f:onUpdate(sinceLastUpdate); end);

function f:onUpdate(sinceLastUpdate)
self.sinceLastUpdate = (self.sinceLastUpdate or 0) + sinceLastUpdate;
if ( self.sinceLastUpdate >= 5 ) then -- in seconds
if UnitInBattleground("player") == nil then
QueueBgs(AsTeam,Random)
end
self.sinceLastUpdate = 0;
end
end

Join the Conversation

Return to Forum