Code:
running = 0
entrytime = 0
inbattle = 0
join = 0
joinpause = 0
function AutojoinOnLoad()
DEFAULT_CHAT_FRAME:AddMessage("<Autojoin an>", 1, 0, 0)
this:RegisterEvent("ZONE_CHANGED_NEW_AREA")
this:RegisterEvent("BATTLEFIELDS_SHOW")
this:RegisterEvent("UPDATE_BATTLEFIELD_STATUS")
SlashCmdList["BGASSISTTOGGLE"] = AutojoinToggle;
SLASH_AUTOJOINTOGGLE1 = "/toggle";
end
function AutojoinToggle()
if (running == 0) then
running = 1
DEFAULT_CHAT_FRAME:AddMessage("<Autojoin an>", 0, 1, 0)
else
running = 0
DEFAULT_CHAT_FRAME:AddMessage("<Autojoin aus>", 1, 0, 0)
end
end
function AutojoinOnEvent()
if (event == "ZONE_CHANGED_NEW_AREA") then
SetMapToCurrentZone()
elseif (event == "UPDATE_BATTLEFIELD_STATUS") then
if (running == 1) then
InBattle()
if (inbattle == 0) then
local index = nil
for i=1, MAX_BATTLEFIELD_QUEUES do
status, mapName, instanceID = GetBattlefieldStatus(i)
if status == "confirm" then
DEFAULT_CHAT_FRAME:AddMessage("<Joini in 10 sekunden>", 1, 0.5, 0)
entrytime = GetTime()
index = i
bgindex = index
end
end
end
end
end
end
function AutojoinOnUpdate()
if (running == 1) then
InBattle()
if (inbattle == 0) then
if (GetBattlefieldStatus(1) == "none") or (GetBattlefieldStatus(2) == "none") or (GetBattlefieldStatus(3) == "none") then
if (joinpause == 0) then
if (join == 0) then
join = 1
BattlegroundType1:Click();
joinpause = GetTime()
elseif (join == 1) then
join = 2
BattlegroundType2:Click();
joinpause = GetTime()
elseif (join == 2) then
join = 0
BattlegroundType3:Click();
joinpause = GetTime()
end
else
if (GetTime() > (joinpause + .5)) then
JoinBattlefield(0)
joinpause = 0
end
end
end
end
if UnitIsDeadOrGhost("player") then
RepopMe()
end
expiration = GetBattlefieldInstanceExpiration()
if (expiration > 0) then
LeaveBattlefield()
end
if (entrytime > 0) then
if (GetTime() > (entrytime + 10)) then
AcceptBattlefieldPort(bgindex,1)
StaticPopup_Hide("CONFIRM_BATTLEFIELD_ENTRY")
bgindex = nil
entrytime = 0
end
end
end
end
function InBattle()
if (GetRealZoneText() == "Alterac Valley") or (GetRealZoneText() == "Warsong Gulch") or (GetRealZoneText() == "Arathi Basin") then
inbattle = 1
else
inbattle = 0
end
end
So, per /toggle wird autoqueue und autojoin aktiviert, allerdings nur fuer AV, AB und WS.
Wie bekomme ichs hin, das es für ADS und Strand auch anmeldet? oder z.B. nur für Strand/ADS?
/edit:
Michael Jackson has died btw.
mfG






