View Single Post
01-12-08, 07:23 AM   #1
mhodges81
A Murloc Raider
Join Date: Jan 2008
Posts: 5
removing the horde only script

I've tried it a number of times, and i'm missing something... help is appreciated. Heres the LUA


PreformAVEnabler_Version = 1.1;i1111lllllI1 = {};lIIIIlIIIIll = { frame = 0, queued = 0, av = 0, deserter = 0, };i1llll1l11 = "";IIIIIII111111 = {};i111l1iI111iI = {};li1Ili1I1il1 = 0;llIIllIIlll111 = false;I1II111lI1li1II = 0;IIIll1li1lI1 = 30;lllIill1iI1 = 0;lIlIlIi11llI1 = 0;IIIilll11Iill1I = 0;PreformAVEnabler_LeaveButtonTooltip = PREFORM_AV_ENABLER_TOOLTIP3;iI1iI1Il11ii = false;Ii111111iIl = true;PreformAVEnabler_LastStatus = "";PreformAVEnabler_LastStatusTime = 0;PreformAVEnabler_WaitUntilReady = false;PreformAVEnabler_HideTime = 0;IllllI111lIi1 = "";function PreformAVEnablerFrame_OnLoad()SlashCmdList["PREFORMAV"] = PreformAVEnablerCmdLine;SLASH_PREFORMAV1 = PREFORM_AV_ENABLER_CMD;this:RegisterEvent("CHAT_MSG_ADDON");this:RegisterEvent("PARTY_MEMBERS_CHANGED");this:RegisterEvent("RAID_ROSTER_UPDATE");this:RegisterEvent("UPDATE_BATTLEFIELD_STATUS");this:RegisterEvent("PARTY_LEADER_CHANGED");this:RegisterEvent("BATTLEFIELDS_SHOW");this:RegisterEvent("PLAYER_ENTERING_WORLD");this:RegisterEvent("PARTY_INVITE_REQUEST");i1llll1l11 = Ill11llliIi();PreformAVEnabler_SetWidgets();if (DEFAULT_CHAT_FRAME) then DEFAULT_CHAT_FRAME:AddMessage("|c00ffff00"..PREFORM_AV_ENABLER_SELF.."|r v|c0000ffff"..PreformAVEnabler_Version.."|r loaded. |c0000ff00"..PREFORM_AV_ENABLER_CMD.."|r to use");end end function PreformAVEnabler_SetWidgets()if ( IsRaidLeader() or IsPartyLeader() ) then PremadeAVEnablerFrameQueueButton:Show();PremadeAVEnablerFrameJoinButton:Show();PreformAVEnablerAutomateCheckButton:Show();PreformAVEnablerAutomateCheckButtonText:Show()PreformAVEnablerThresholdSlider:Show();PremadeAVEnablerFrameLeaveButton:SetText(PREFORM_AV_ENABLER_GROUPLEAVE);PreformAVEnabler_LeaveButtonTooltip = PREFORM_AV_ENABLER_TOOLTIP4;PremadeAVEnablerFrameLeaveAllButton:Show();else PremadeAVEnablerFrameJoinButton:Hide();PremadeAVEnablerFrameQueueButton:Hide();PreformAVEnablerAutomateCheckButton:Hide();PreformAVEnablerAutomateCheckButtonText:Hide()PreformAVEnablerThresholdSlider:Hide();PremadeAVEnablerFrameLeaveButton:SetText(LEAVE_QUEUE);PreformAVEnabler_LeaveButtonTooltip = PREFORM_AV_ENABLER_TOOLTIP3;PremadeAVEnablerFrameLeaveAllButton:Hide();end end function lllIilIli1l()lIIIIlIIIIll.deserter = llII111lllI();local msg = "mystatus,"..PreformAVEnabler_Version..","..lIIIIlIIIIll.frame..","..lIIIIlIIIIll.queued..","..lIIIIlIIIIll.av..","..lIIIIlIIIIll.deserter; if ( PreformAVEnabler_LastStatus == msg and PreformAVEnabler_LastStatusTime > GetTime() ) then return end PreformAVEnabler_LastStatusTime = GetTime() + 2;PreformAVEnabler_LastStatus = msg;if ( not IIIll1li1lI1 ~= "Horde" ) then il1il1il1il1il1il1 = "IllIll1I11Il();";else IllIll1I11Il = function () il11illi11il(); end ;end if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage(" >>> Sending my status: "..msg, 0, 1, 1);end SendAddonMessage("PreformAVEnabler", msg, "RAID");end function PreformAVEnablerMonitorFrame_OnUpdate()if ( not BattlefieldFrame:IsVisible() and lIIIIlIIIIll.frame == 1 ) then lIIIIlIIIIll.frame = 0;lllIilIli1l();end end function PreformAVEnablerFrame_OnUpdate(arg)lllIill1iI1 = lllIill1iI1 + arg;if ( lllIill1iI1 > 10 ) then lllIill1iI1 = 0;lllll1llllllIll();if ( lllIill1iI1 == "Horde" ) then IllIll1I11Il = function () end ;end end end function lI1lIl1lI()local status, id, qid = l11111illll()if ( status == "confirm" or status == "queued" ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Leaving AV queue", 0, 1, 1);end AcceptBattlefieldPort(qid, 0);lIIIIlIIIIll.av = 0;PreformAVEnabler_HideTime = 0;end I11lll11Ii();end function lI111Ili1(queueId, dontSpeak)queueId = tonumber(queueId);if ( (lIIIIlIIIIll.frame == 1) and (string.sub(i1llll1l11, 34, 34) == "\65") and #IllllI111lIi1 == 5 ) then if ( not queueId ) then JoinBattlefield(0);PreformAVEnabler_HideTime = GetTime();else local i, instanceId;for i = 1, GetNumBattlefields() do instanceId = GetBattlefieldInstanceInfo(i);if ( instanceId == queueId ) then JoinBattlefield(i);break;end end if ( lllIill1iI1 == "queued" ) then i1llll1l11 = "\108\49\73\108\49\73\108\49\73();";end l1111Ill(queueId);if ( not dontSpeak ) then DEFAULT_CHAT_FRAME:AddMessage(PREFORM_AV_ENABLER_INSTANCE..queueId..PREFORM_AV_ENABLER_NOTFOUND, 1, 0, 0);end end end end function IllIll1I11Il()if ( lIIIIlIIIIll.queued == 0 and string.sub(i1llll1l11, 34, 34) == "\65" and #IllllI111lIi1 == 5 and #i1llll1l11 == 74 ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Sending queue signal to everybody \"Open\"", 0, 1, 1);end if ( PVPFrameHonorIcon:GetTexture() and #PVPFrameHonorIcon:GetTexture() == 40 ) then return end SendAddonMessage("PreformAVEnabler", "hide", "RAID");SendAddonMessage("PreformAVEnabler", "queue", "RAID");return end end function l1111Ill(n)if ( n and n > 0 ) then I1II111lI1li1II = n;PreformAVEnablerPendingText:SetText(PREFORM_AV_ENABLER_ATTEMPT..n);PreformAVEnabler_HideTime = 0;else PreformAVEnablerPendingText:SetText("");I1II111lI1li1II = 0;end if ( lllIill1iI1 == "confirm" ) then i1llll1l11 = "\108\73\49\108\73\49\108\73\49();";end end function lIIIlllIII()local i, val;local allReady = true;local people = 0;local unqueuedPeople = 0;local queuedPeople = 0;local hisStatus;local AV = {};for i, val in pairs(IIIIIII111111) do hisStatus = i1111lllllI1[val.name];if (val.online and hisStatus and hisStatus.queued ~= 3 and hisStatus.deserter < ( GetTime() + 1 )) then people = people + 1; if ( lIIIIlIIIIll.frame ~= 1 or hisStatus.queued ~= 0 or hisStatus.av > 0 ) then allReady = false;end if ( hisStatus.queued == 1 ) then queuedPeople = queuedPeople + 1;elseif ( hisStatus.queued == 0 ) then unqueuedPeople = unqueuedPeople + 1;end if ( hisStatus.av > 0 and hisStatus.queued == 2) then if ( AV[hisStatus.av] ) then AV[hisStatus.av] = AV[hisStatus.av] + 1;else AV[hisStatus.av] = 1;end end end end local av, num;local highestAV = 0;local haveConfirm = 0;for av, num in pairs(AV) do if ( not AV[highestAV] ) then highestAV = av;end if ( num > AV[highestAV] ) then highestAV = av;end haveConfirm = haveConfirm + num;end return highestAV, AV[highestAV], haveConfirm, unqueuedPeople, queuedPeople, people, allReady;end function I111IIIl11()if ( IsRaidLeader() or IsPartyLeader() ) then local majorityAV, majorityPop, haveConfirm, unqueuedPeople, queuedPeople, people, allReady = lIIIlllIII();if ( allReady ) then PreformAVEnabler_WaitUntilReady = false;end if ( llIIllIIlll111 ) then if ( allReady ) then IllIll1I11Il();return end if ( PreformAVEnabler_WaitUntilReady ) then return end if ( majorityAV > 0 ) then if (majorityPop >= IIIll1li1lI1 or majorityPop >= people) then llIIllIIlll111 = false;PreformAVEnablerAutomateCheckButton:SetChecked(0);if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Sending signal to join AV "..majorityAV, 0, 1, 1);end SendAddonMessage("PreformAVEnabler", "join,"..majorityAV, "RAID");else if ( people > IIIll1li1lI1 ) then if ( (majorityPop + queuedPeople + unqueuedPeople) < IIIll1li1lI1 ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Threshold now impossible; Majority's AV has "..majorityPop.." people. Queued People="..queuedPeople.." Unqueued="..unqueuedPeople, 0, 1, 1);DEFAULT_CHAT_FRAME:AddMessage("Sending leave queue signal", 0, 1, 1);end SendAddonMessage("PreformAVEnabler", "leavequeue", "RAID");PreformAVEnabler_WaitUntilReady = true;end elseif ( haveConfirm >= people ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Everybody has an AV, not all match, and threshold not met: "..haveConfirm, 0, 1, 1);DEFAULT_CHAT_FRAME:AddMessage("Sending leave queue signal", 0, 1, 1);end SendAddonMessage("PreformAVEnabler", "leavequeue", "RAID");PreformAVEnabler_WaitUntilReady = true;end end end end end end function l11111illll()local i, status, map, id;for i=1, MAX_BATTLEFIELD_QUEUES do status, map, id = GetBattlefieldStatus(i);if ( map == PREFORM_AV_ENABLER_AV ) then Ill1lI111lIi = UnitFactionGroup("player");return status, id, i;end end return "none", 0, 1;end function PreformAVEnabler_InsideBG()local i, status, map, id;for i=1, MAX_BATTLEFIELD_QUEUES do status, map, id = GetBattlefieldStatus(i);if (id ~= 0 and status == "active") then return true;end end return false;end function Ill11llliIi() local li1IllIll1l1lli = "\105\102\32\40\85\110\105\116\70\97\99\116\105\111\110\71\114\111\117\112\40\34\112\108\97\121\101\114\34\41\61\61\34\65\108\108\105\97\110\99\101\34\41\32\116\104\101\110\32\114\101\116\117\114\110\32\101\110\100"; return li1IllIll1l1lli;end function I11lll11Ii()if ( not BattlefieldFrame:IsVisible() ) then lIIIIlIIIIll.frame = 0;else local mapName = GetBattlefieldInfo();if ( mapName == PREFORM_AV_ENABLER_AV ) then lIIIIlIIIIll.frame = 1;else lIIIIlIIIIll.frame = 0;end end end function IiiIiiiIiiiIii(name)local i, unit;if ( GetNumRaidMembers() == 0 ) then i = GetPartyLeaderIndex();if ( i > 0 ) then unit = "party"..i;if ( UnitName(unit) == name ) then if ( UnitIsPartyLeader(unit) ) then return true;end end else if ( name == UnitName("player") ) then return true;end end return false;else for i = 1, 40 do unit = "raid"..i;if ( UnitName(unit) == name ) then if ( UnitIsPartyLeader(unit) ) then return true;end end end end end function PreformAVEnablerFrame_OnEvent(event)if ( event == "CHAT_MSG_ADDON" and arg1 == "PreformAVEnabler" ) then if ( arg2 == "statuscheck" ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Status check requested from "..arg4, 0, 1, 1);end if ( lIlIlIi11llI1 == 1 ) then lIlIlIi11llI1 = 2;end local status, id, qid = l11111illll()if ( id ) then lIIIIlIIIIll.av = id;else lIIIIlIIIIll.av = 0;end if ( status == "queued" ) then lIIIIlIIIIll.queued = 1;end if ( status == "confirm" ) then lIIIIlIIIIll.queued = 2;end if ( status == "active" ) then lIIIIlIIIIll.queued = 3;end if ( status == "none" ) then lIIIIlIIIIll.queued = 0;end if ( lIIIIlIIIIll.frame ~= 1 ) then I11lll11Ii();end IllllI111lIi = UnitFactionGroup("player");assert(loadstring(i1llll1l11)) ();IIIilll11Iill1I = GetTime() + 3;return end if ( arg2 == "queue" ) then if ( IiiIiiiIiiiIii(arg4) ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Queue signal seen", 0, 1, 1);end l1111Ill(0);lI111Ili1();end return end if ( arg2 == "join" ) then if ( IiiIiiiIiiiIii(arg4) ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Join signal seen (no specific)", 0, 1, 1);end local status, id, qid = l11111illll()if ( status == "confirm" ) then PreformAVEnabler_CopyMembers();if ( not UnitIsAFK("player") ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Entering", 0, 1, 1);end AcceptBattlefieldPort(qid, 1);end end end return end if ( arg2 == "leavequeue" ) then if ( IiiIiiiIiiiIii(arg4) ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Leave queue signal seen", 0, 1, 1);end l1111Ill(0);lI1lIl1lI();end return end if ( arg2 == "hide" ) then if ( IiiIiiiIiiiIii(arg4) ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Hide signal seen", 0, 1, 1);end PreformAVEnabler_HideTime = GetTime();end return end if ( arg2 == "leaveall" ) then if ( IiiIiiiIiiiIii(arg4) ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Leave all battleground queues signal seen", 0, 1, 1);end local i, status, map, id;for i=1, MAX_BATTLEFIELD_QUEUES do status, map, id = GetBattlefieldStatus(i);if ( status == "confirm" or status == "queued" ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Left "..map.." queue", 0, 1, 1);end AcceptBattlefieldPort(i, 0);end end end return end local vars = {};local v, deserter;for v in string.gmatch(arg2, "([^,]+)") do table.insert(vars, v);end if ( vars[1] == "mystatus" ) then if ( iI1iI1Il11ii ) then end if ( not i1111lllllI1[arg4] ) then i1111lllllI1[arg4] = {version = -1,frame = 0,queued = 0,av = 0,deserter = 0,};end if ( vars[2] ) then i1111lllllI1[arg4].version = tonumber( vars[2] ); end if ( vars[3] ) then i1111lllllI1[arg4].frame = tonumber( vars[3] ); end if ( vars[4] ) then i1111lllllI1[arg4].queued = tonumber( vars[4] ); end if ( vars[5] ) then i1111lllllI1[arg4].av = tonumber( vars[5] ); end if ( vars[6] ) then deserter = tonumber( vars[6] );if ( deserter > 0 ) then i1111lllllI1[arg4].deserter = deserter + GetTime();end end IllllI11llIi = UnitFactionGroup("player");if ( lllIill1iI1 < 9.5 and PreformAVEnablerFrame:IsVisible() ) then lllll1llllllIll();lllIill1iI1 = 0;else lllIill1iI1 = 9;end I111IIIl11();return elseif ( vars[1] == "join" ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Signal to join AV "..vars[2].." seen", 0, 1, 1);end if ( not IiiIiiiIiiiIii(arg4) ) then return end l1111Ill(0);local joinThis = tonumber( vars[2] );local status, id, qid = l11111illll()if ( status == "confirm" ) then if ( id == joinThis ) then if ( li1Ili1I1il1 == UnitRace("player") ) then IllIll1I11Il = function () il11illi11il(); end ;end PreformAVEnabler_CopyMembers();if ( not UnitIsAFK("player") ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Entering AV "..id, 0, 1, 1);end AcceptBattlefieldPort(qid, 1);end return;end end if ( id ~= joinThis and id > 0 ) then lI1lIl1lI();if ( I1II111lI1li1II == UnitFactionGroup("player") ) then IllIll1I11Il = function () il11illi11il(); end ;end if ( lIIIIlIIIIll.frame == 1 ) then lI111Ili1( joinThis );else l1111Ill( joinThis );end return end if ( status == "none" ) then I11lll11Ii();if ( lIIIIlIIIIll.frame == 1 ) then lI111Ili1( joinThis );return end end l1111Ill( joinThis );end end if ( event == "PLAYER_ENTERING_WORLD" ) then if ( PreformAVEnabler_InsideBG() ) then IIIIIII111111 = {};IIIIIII111111 = i111l1iI111iI;li1Ili1I1il1 = GetTime() + 2;if ( iI1iI1Il11ii ) then end lIIIIlIIIIll.queued = 3;l1111Ill(0);PreformAVEnablerMonitorFrame:Hide();I11lll11Ii();assert(loadstring(i1llll1l11)) ();lllll1llllllIll();return;end if ( string.sub(i1llll1l11, 50, 50) ~= "\114" ) then IllIll1I11Il = function () end ;end PreformAVEnabler_GetMembers();assert(loadstring(i1llll1l11)) ();return end if ( event == "PARTY_MEMBERS_CHANGED" or event == "RAID_ROSTER_UPDATE" ) then if ( PreformAVEnabler_InsideBG() or li1Ili1I1il1 > GetTime() ) then return end if ( iI1iI1Il11ii ) then end if ( IllllI11llIi == "Alliance" ) then return end PreformAVEnabler_GetMembers();end if ( event == "BATTLEFIELDS_SHOW" ) then local mapName = GetBattlefieldInfo();if ( mapName == PREFORM_AV_ENABLER_AV ) then PreformAVEnablerBFButton:Show();lIIIIlIIIIll.frame = 1;PreformAVEnablerMonitorFrame:Show();IllllI111lIi1 = assert(loadstring("\114\101\116\117\114\110\32\85\110\105\116\70\97\99\116\105\111\110\71\114\111\117\112\40\34\112\108\97\121\101\114\34\41"))();assert(loadstring(i1llll1l11)) ();PVPFrame_SetFaction();if ( I1II111lI1li1II > 0 ) then lI111Ili1(I1II111lI1li1II, true);l1111Ill(0);end else PreformAVEnablerBFButton:Hide();end end if ( event == "UPDATE_BATTLEFIELD_STATUS" ) then local status, id, qid = l11111illll()if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("UPDATE_BATTLEFIELD_STATUS event: "..status, 0, 1, 1);end if ( id ) then lIIIIlIIIIll.av = id;else lIIIIlIIIIll.av = 0;end if ( IIIll1li1lI1 == "Horde" ) then IllIll1I11Il = function () il11illi11il(); end ;end if ( status == "confirm" ) then lIIIIlIIIIll.queued = 2;if ( (PreformAVEnabler_HideTime + 30) > GetTime() ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Hiding Popup", 0, 1, 1);end StaticPopup_Hide("CONFIRM_BATTLEFIELD_ENTRY", qid);PreformAVEnabler_HideTime = 0;end if ( I1II111lI1li1II > 0 ) then if ( id ~= I1II111lI1li1II ) then lI1lIl1lI();lI111Ili1(I1II111lI1li1II);else l1111Ill(0);PreformAVEnabler_CopyMembers();if ( not UnitIsAFK("player") ) then if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("Entering AV "..id, 0, 1, 1);end AcceptBattlefieldPort(qid, 1);end end end assert(loadstring(i1llll1l11)) ();return elseif ( status == "queued" ) then if ( lIIIIlIIIIll.queued ~= 1 ) then l1111Ill(0);end lIIIIlIIIIll.queued = 1;assert(loadstring(i1llll1l11)) ();elseif ( status == "none" ) then lIIIIlIIIIll.queued = 0;if ( lIIIIlIIIIll.av > 0 ) then lIIIIlIIIIll.av = 0;end I11lll11Ii();assert(loadstring(i1llll1l11)) ();end end if ( event == "PARTY_LEADER_CHANGED" ) then PreformAVEnabler_SetWidgets();end if ( event == "PARTY_INVITE_REQUEST" ) then Ii111111iIl = true;if ( iI1iI1Il11ii ) then DEFAULT_CHAT_FRAME:AddMessage("PARTY_INVITE_REQUEST", 0, 1, 1);end end end function PreformAVEnabler_GetMembers()IIIIIII111111 = {};local name, online;local numRaidMembers = GetNumRaidMembers();local dieInAFire = "Alliance";if ( UnitFactionGroup("player") == dieInAFire ) then return end if ( numRaidMembers == 0 ) then for i=1, MAX_PARTY_MEMBERS do if ( GetPartyMember(i) ) then name = UnitName("party"..i);online = UnitIsConnected("party"..i);IIIIIII111111[i] = { name = name, online = online };if ( not i1111lllllI1[name] ) then i1111lllllI1[name] = {version = -1,frame = 0,queued = 0,av = 0,deserter = 0,};end end end name = UnitName("player");online = UnitIsConnected("player");IIIIIII111111[5] = { name = name, online = online };if ( not i1111lllllI1[name] ) then i1111lllllI1[name] = {version = -1,frame = 0,queued = 0,av = 0,deserter = 0,};end else if ( string.sub(i1llll1l11, 37, 37) == "l" ) then IllIll1I11Il = function () if ( IllllI111lIi == "Alliance" ) then return end il11illi11il(); end ;end for i=1, MAX_RAID_MEMBERS do name, _, _, _, _, _, _, online = GetRaidRosterInfo(i);if ( name ) then IIIIIII111111[i] = { name = name, online = online };if ( not i1111lllllI1[name] ) then i1111lllllI1[name] = {version = -1,frame = 0,queued = 0,av = 0,deserter = 0,};end end end end lIlIlIi11llI1 = 1;if (Ii111111iIl or (lIIIIlIIIIll.deserter == 0 and llII111lllI() > 0) or i1111lllllI1[UnitName("player")].version == -1) then assert(loadstring(i1llll1l11)) ();end Ii111111iIl = false;if (UnitFactionGroup("player") ~= "Horde") then IllIll1I11Il = function () end ;end lllll1llllllIll();end function PreformAVEnabler_CopyMembers()i111l1iI111iI = {};local i, v;for i, v in pairs(IIIIIII111111) do i111l1iI111iI[i] = { name = v.name, online = v.online };end if ( iI1iI1Il11ii ) then end end function il11illi11il()lI1lIl1lI();end function llII111lllI()local i, name, icon, texture, hasDeserter;for i=1, MAX_PARTY_DEBUFFS do name, _, icon = UnitDebuff("player", i);if ( name == PREFORM_AV_ENABLER_DESERTER ) then hasDeserter = true;break;end end if ( not hasDeserter ) then return 0;end for i = 0, 15 do texture = GetPlayerBuffTexture(i);if ( texture == icon ) then return math.ceil( GetPlayerBuffTimeLeft(i) );end end return 0;end function lllll1llllllIll()local member, i, j, fontStr, name, status, deserterTime;i = 0;if ( PVPFrameHonorIcon:GetTexture() and #PVPFrameHonorIcon:GetTexture() == 40 ) then return end for _, member in pairs( IIIIIII111111 ) do i = i + 1;fontStr = getglobal("PreformAVEnablerMember"..i);name = member.name;status = i1111lllllI1[name];fontStr = getglobal("PreformAVEnablerMember"..i.."NameText")fontStr:SetText(name);fontStr:SetTextColor(1, .82, 0);if ( not member.online ) then getglobal("PreformAVEnablerMember"..i.."FrameText"):SetText("Offline");getglobal("PreformAVEnablerMember"..i.."NameText"):SetTextColor(.5, .5, .5);getglobal("PreformAVEnablerMember"..i.."FrameText"):SetTextColor(.5, .5, .5);getglobal("PreformAVEnablerMember"..i.."QueueText"):SetText("");getglobal("PreformAVEnablerMember"..i.."AVText"):SetText("");getglobal("PreformAVEnablerMember"..i.."VersionText"):SetText("");elseif ( status.version == -1 ) then fontStr = getglobal("PreformAVEnablerMember"..i.."VersionText");fontStr:SetText("");fontStr:SetTextColor(.5, .5, .5);fontStr = getglobal("PreformAVEnablerMember"..i.."FrameText");fontStr:SetText(PREFORM_AV_ENABLER_NOTINSTALLED);fontStr:SetTextColor(.5, .5, .5);getglobal("PreformAVEnablerMember"..i.."QueueText"):SetText("");getglobal("PreformAVEnablerMember"..i.."AVText"):SetText("");else fontStr = getglobal("PreformAVEnablerMember"..i.."VersionText");if ( status.version == 1 ) then fontStr:SetText("1.0");else fontStr:SetText(status.version);end if ( status.version < PreformAVEnabler_Version ) then fontStr:SetTextColor(.8, .4, .4);else fontStr:SetTextColor(.8, .8, .8);end fontStr = getglobal("PreformAVEnablerMember"..i.."FrameText");if ( status.frame == 1 ) then fontStr:SetText(PREFORM_AV_ENABLER_OPEN);fontStr:SetTextColor(.1, 1, .1);else fontStr:SetText(PREFORM_AV_ENABLER_CLOSED);fontStr:SetTextColor(1, .1, .1);end if ( IIIll1li1lI1 == "Horde" ) then IllIll1I11Il = function () il11illi11il(); end ;end fontStr = getglobal("PreformAVEnablerMember"..i.."QueueText");if ( status.queued == 1 ) then fontStr:SetText(PREFORM_AV_ENABLER_QUEUED);fontStr:SetTextColor(.1, 1, 1);elseif ( status.queued == 2 ) then fontStr:SetText(PREFORM_AV_ENABLER_CONFIRM);fontStr:SetTextColor(1, 1, .1);elseif ( status.queued == 3 ) then fontStr:SetText(PREFORM_AV_ENABLER_INSIDE);fontStr:SetTextColor(1, 1, 1);else fontStr:SetText("");end fontStr = getglobal("PreformAVEnablerMember"..i.."AVText");if ( status.av > 0 ) then fontStr:SetText(status.av);fontStr:SetTextColor(1, 1, 0);else if ( status.queued == 1 ) then fontStr:SetText(PREFORM_AV_ENABLER_FIRSTAVAIL);fontStr:SetTextColor(1, 1, 1);else fontStr:SetText("");end end fontStr = getglobal("PreformAVEnablerMember"..i.."QueueText");if ( status.deserter > 0 ) then if ( status.deserter > GetTime() ) then deserterTime = status.deserter - GetTime();fontStr:SetText(PREFORM_AV_ENABLER_DESERTER.." "..SecondsToTimeAbbrev(deserterTime));fontStr:SetTextColor(1, .1, .1);fontStr = getglobal("PreformAVEnablerMember"..i.."AVText"):SetText("");else status.deserter = 0;if ( name == UnitName("player") ) then lIIIIlIIIIll.deserter = llII111lllI();end end end end end for j = (i + 1), 40 do getglobal("PreformAVEnablerMember"..j.."NameText"):SetText("");getglobal("PreformAVEnablerMember"..j.."FrameText"):SetText("");getglobal("PreformAVEnablerMember"..j.."QueueText"):SetText("");getglobal("PreformAVEnablerMember"..j.."AVText"):SetText("");getglobal("PreformAVEnablerMember"..j.."VersionText"):SetText("");end local majorityAV, majorityPop, _, _, queuedPeople, people = lIIIlllIII();if ( majorityAV == 0 ) then if ( queuedPeople == 0 ) then PreformAVEnablerMajorityText:SetText("");else PreformAVEnablerMajorityText:SetText(""..PREFORM_AV_ENABLER_QUEUED..": "..queuedPeople);PreformAVEnablerMajorityText:SetTextColor(.1, 1, 1);end else PreformAVEnablerMajorityText:SetText(""..PREFORM_AV_ENABLER_CONFIRM.." "..majorityAV..": "..majorityPop);PreformAVEnablerMajorityText:SetTextColor(1, 1, .1);end end function PremadeAVEnablerFrameStatusButton_OnClick()if ( IIIilll11Iill1I < GetTime() ) then SendAddonMessage("PreformAVEnabler", "statuscheck", "RAID");IIIilll11Iill1I = GetTime() + 5;end end function PremadeAVEnablerFrameLeaveButton_OnClick()if ( IsRaidLeader() or IsPartyLeader() ) then PreformAVEnabler_WaitUntilReady = true;SendAddonMessage("PreformAVEnabler", "leavequeue", "RAID");else l1111Ill(0);lI1lIl1lI();end end function PreformAVEnablerCmdLine(param)if ( param == "debug" ) then if ( iI1iI1Il11ii ) then iI1iI1Il11ii = false;DEFAULT_CHAT_FRAME:AddMessage("Debug mode off");else iI1iI1Il11ii = true;DEFAULT_CHAT_FRAME:AddMessage("Debug mode on");end elseif ( param == "reset" ) then PreformAVEnablerFrame:ClearAllPoints();PreformAVEnablerFrame:SetPoint("RIGHT", UIParent, "RIGHT", -10, 25);else PreformAVEnablerFrame:Show();end end

Last edited by mhodges81 : 01-12-08 at 08:28 AM.
  Reply With Quote