Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menuframe = CreateFrame("FRAME");
- Gcontrol = { };
- function Gcontrol:initDropdowns(player)
- UnitPopupButtons["GD_CONTROLS"] = {text = "|cFF00FFFFGuild Controls", dist = 0, nested = 1, tooltipText = "|cFF00FFFFShows options for inviting, kicking, promoting and demoting players within the guild.." };
- UnitPopupButtons["GKICK"] = {text = "|cFF00FFFFKick from guild?", dist = 0, nested = 1, checkable = nil};
- UnitPopupButtons["GPROMOTE"] = {text = "|cFF00FFFFPromote player?", dist = 0, nested = 1, checkable = nil};
- UnitPopupButtons["GDEMOTE"] = {text = "|cFF00FFFFDemote Player?", dist = 0, nested = 1, checkable = nil};
- UnitPopupButtons["GINVITE"] = {text = "|cFF00FFFFGuild invite player?", dist = 0, nested = 1, checkable = nil};
- UnitPopupButtons["GCANCEL"] = {text = "|cFF00FFFFCancel", dist = 0, nested = 1, notCheckable = nil};
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GD_CONTROLS");
- --[[tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GKICK");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GINVITE");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GPROMOTE");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GDEMOTE");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "GCANCEL");]]--
- UnitPopupMenus["GD_CONTROLS"] = {"GKICK", "GPROMOTE", "GDEMOTE", "GINVITE", "GCANCEL"};
- hooksecurefunc("UnitPopup_OnClick", function(...) Gcontrol:UnitPopup_OnClick(...); end);
- end
- function Gcontrol:UnitPopup_OnClick(self)
- local name = UIDROPDOWNMENU_INIT_MENU.name
- button = self.value
- if(button == "GKICK") then
- print(name)
- GuildUninvite(name)
- elseif (button == "GPROMOTE") then
- GuildPromote(name)
- elseif (button == "GDEMOTE") then
- GuildDemote(name)
- elseif (button == "GINVITE") then
- GuildInvite(name)
- end
- end
- Gcontrol:initDropdowns();
- function ShowACMinimap()
- GameTooltip:SetOwner(MinimapButton, "ANCHOR_LEFT");
- GameTooltip:AddLine( "|cFFcc33ffArena Point Calculator|r" );
- GameTooltip:AddLine( "|cFF00FFCCLeft click to show/hide|r" );
- GameTooltip:AddLine( "|cFFFF0000Right click to drag this|r" );
- GameTooltip:Show();
- end
- local frame = CreateFrame("CheckButton", "FarmModeCheckButton", ArenaCalculator, "UICheckButtonTemplate")
- frame:ClearAllPoints()
- frame:SetPoint("LEFT", 15, 20)
- _G[frame:GetName() .. "Text"]:SetText("Enable Farm Mode")
- local frame = CreateFrame("Button", "ACcloseButton", ArenaCalculator, "UIPanelCloseButton")
- frame:ClearAllPoints()
- frame:SetPoint("TOPRIGHT", 0, 0)
- local frame = CreateFrame("Button", "ACcancel", ArenaCalculator, "UIPanelButtonTemplate")
- frame:ClearAllPoints()
- frame:SetPoint("BOTTOMRIGHT",-15,15)
- frame:SetWidth(80)
- frame:SetHeight(22)
- frame:SetText("Cancel")
- frame:RegisterForClicks(AnyUp)
- frame:SetScript("OnMouseUp", function(self, button)
- ArenaCalculator:Hide()
- end)
- local frame = CreateFrame("Button", "ACsave", ArenaCalculator, "UIPanelButtonTemplate")
- frame:ClearAllPoints()
- frame:SetPoint("BOTTOMRIGHT",-100,15)
- frame:SetWidth(80)
- frame:SetHeight(22)
- frame:SetText("Save")
- frame:RegisterForClicks(AnyUp)
- frame:SetScript("OnMouseUp", function(self, button)
- if FarmModeCheckButton:GetChecked() then
- FarmMode = true
- ArenaCalculator:Hide()
- print("|cff00ccffFarm Mode:|r |cffcc33ffOn.|r")
- else
- FarmMode = false
- ArenaCalculator:Hide()
- print("|cff00ccffFarm Mode:|r |cffcc33ffOff.|r")
- end
- end)
- --[[arenapoints = {}
- function arenatest(twos, threes, fives)
- arena = 1
- while (arena <= 3) do
- teamName, teamSize, teamRating, teamPlayed, teamWins, seasonTeamPlayed, seasonTeamWins, playerPlayed, seasonPlayerPlayed, teamRank, playerRating = GetArenaTeam(arena)
- if (teamSize == 2) then
- rating = teamRating - playerRating
- if (teamRating > 1500) and (rating < 150) then
- fivespoints = math.floor(1511.26/(1+1639.28*math.pow(2.71828, -0.00412*teamRating)))
- total = math.ceil(fivespoints*0.76)
- twos = teamRating
- table.insert(arenapoints, total)
- elseif (teamRating > 1500) and (rating > 150) then
- fivespoints = math.floor(0.22*playerRating+14)
- total = math.floor(fivespoints*0.76)
- twos = playerRating
- table.insert(arenapoints, total)
- elseif (teamRating < 1500) then
- fivespoints = math.floor(0.22*teamRating+14)
- total = math.ceil(fivespoints*0.76)
- twos = teamRating
- table.insert(arenapoints, total)
- end
- arena = arena + arena
- end
- if (teamSize == 3) then
- rating = teamRating - playerRating
- if (teamRating > 1500) and (rating < 150) then
- fivespoints = math.floor(1511.26/(1+1639.28*math.pow(2.71828, -0.00412*teamRating)))
- total = math.ceil(fivespoints*0.88)
- threes = teamRating
- table.insert(arenapoints, total)
- elseif (teamRating > 1500) and (rating > 150) then
- fivespoints = math.floor(0.22*playerRating+14)
- total = math.floor(fivespoints*0.88)
- threes = playerRating
- table.insert(arenapoints, total)
- elseif (teamRating < 1500) then
- fivespoints = math.floor(0.22*teamRating+14)
- total = math.ceil(fivespoints*0.88)
- threes = teamRating
- table.insert(arenapoints, total)
- end
- arena = arena + 1
- end
- if (teamSize == 5) then
- rating = teamRating - playerRating
- if (teamRating > 1500) and (rating < 150) then
- total = math.floor(1511.26/(1+1639.28*math.pow(2.71828, -0.00412*teamRating)))
- fives = teamRating
- table.insert(arenapoints, total)
- elseif (teamRating > 1500) and (rating > 150) then
- total = math.floor(0.22*playerRating+14)
- fives = playerRating
- table.insert(arenapoints, total)
- elseif (teamRating < 1500) then
- total = math.floor(0.22*teamRating+14)
- fives = teamRating
- table.insert(arenapoints, total)
- end
- arena = arena + 1
- end
- if (teamSize == 0) then
- arena = arena + arena
- end
- end
- Totalpoints(twos, threes, fives)
- end
- function GetInfo(twos, threes, fives)
- print("Gathering Data...")
- if (twos) then
- ArenaCalculator.twos:SetText("|cffcc33ff " ..twos.."|r")
- end
- if (threes) then
- ArenaCalculator.threes:SetText("|cffcc33ff " ..threes.. "|r")
- end
- if (fives) then
- ArenaCalculator.fives:SetText("|cffcc33ff" ..fives.."|r")
- end
- if not twos then
- ArenaCalculator.twos:SetText("|cffcc33ffNo Team|r")
- end
- if not threes then
- ArenaCalculator.threes:SetText("|cffcc33ffNo Team|r")
- end
- if not fives then
- ArenaCalculator.fives:SetText("|cffcc33ffNo Team|r")
- end
- if (#arenapoints ~= 0) then
- ArenaCalculator.arenapoints:SetText("|cffcc33ff " ..arenapoints[#arenapoints].. "|r")
- end
- if (#arenapoints == 0) then
- ArenaCalculator.arenapoints:SetText("|cffcc33ff0|r")
- end
- ArenaCalculator:Show()
- end]]--
- --[[local fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("Left",100,50)
- fontstring:SetText("|cff00ccffArena Points:|r")
- ArenaCalculator.APHeader = fontstring]]--
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("Left",15,50)
- fontstring:SetText("|cff00ccffFarm Mode:|r")
- ArenaCalculator.ratings = fontstring
- --[[fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",15,20)
- fontstring:SetText("|cff00ccff2vs2:|r")
- ArenaCalculator.header2v2 = fontstring
- twos = nil;
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",50,20)
- ArenaCalculator.twos = fontstring
- threes = nil;
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",50,-10)
- ArenaCalculator.threes = fontstring
- fives = nil;
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",50,-40)
- ArenaCalculator.fives = fontstring
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",185,50)
- ArenaCalculator.arenapoints = fontstring
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",15,-10)
- fontstring:SetText("|cff00ccff3vs3:|r")
- ArenaCalculator.header3v3 = fontstring
- fontstring = ArenaCalculator:CreateFontString(nil, "OVERLAY", "GameTooltipText")
- fontstring:SetHeight(50)
- fontstring:SetPoint("LEFT",15,-40)
- fontstring:SetText("|cff00ccff5vs5:|r")
- ArenaCalculator.header5v5 = fontstring]]--
- if not Looter then
- Looter = CreateFrame("frame")
- end
- local frame = Looter
- frame:RegisterEvent("ADDON_LOADED")
- frame:RegisterEvent("PLAYER_LOGOUT")
- frame:RegisterEvent("LOOT_OPENED")
- frame:RegisterEvent("GMRESPONSE_RECEIVED")
- frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- frame:RegisterEvent("UNIT_AURA")
- frame:SetScript("OnEvent", function(self, event, ...)
- local scm = SendChatMessage
- if (event == "GMRESPONSE_RECEIVED") then
- --SendChatMessage("Waaaaaaaat", "WHISPER", nil, "Xolitude")
- end
- if event == "COMBAT_LOG_EVENT_UNFILTERED" then
- local arg = { ... }
- for i,v in ipairs(arg) do
- if (arg[2] == "SPELL_AURA_APPLIED") then
- local me = UnitName("player")
- if (string.find(arg[i], "(.*)Raw(.*)Fury(.*)")) then
- local start, duration, enable = GetItemCooldown(59461)
- local auraName,_,_,auraCount = UnitBuff("player", "Raw Fury");
- if (auraCount == 5) and (duration == 0) then
- RaidNotice_AddMessage(RaidBossEmoteFrame,"Raw Fury has stacked to 5! Use the trinket now! " ..UnitName("player"), ChatTypeInfo["RAID_WARNING"]);
- PlaySoundFile("Sound\\interface\\RaidWarning.wav");
- end
- end
- end
- end
- end
- if event == "ADDON_LOADED" and FarmMode == nil then
- if (FarmMode == "off" or FarmMode == nil) then
- FarmModeCheckButton:SetChecked(FarmMode)
- else
- FarmModeCheckButton:SetChecked(FarmMode)
- end
- end
- end)
- --[[if (string.find(arg[i], "(.*)Grounding(.*)Totem(.*)")) then
- if (arg[2] == "SWING_DAMAGE") then
- scm(arg[7].. " was killed.")
- end
- if (arg[2] == "SPELL_DAMAGE") then
- local spell = GetSpellLink(arg[10])
- if spell then
- scm("|cff00ccff" ..arg[4].. "|r hits |cff00ccff" ..arg[7].. "|r for |cff00ccff" ..arg[12] - arg[13].. " (" ..arg[13].. " Overkill) with |cff00ccff" ..spell)
- end
- end
- if (arg[2] == "RANGE_DAMAGE") then
- local spell = GetSpellLink(arg[9])
- scm("|cff00ccff" ..arg[4].. "|r hits |cff00ccff" ..arg[7].. "|r for |cff00ccff" ..arg[12] - arg[13].. " (" ..arg[13].. " Overkill) with |cff00ccff" ..spell, "SAY")
- end
- if (arg[2] == "SPELL_CAST_SUCCESS") then
- local spell = GetSpellLink(arg[10])
- if spell then
- scm(spell.. " was absorbed by " ..arg[7], "SAY")
- end
- end
- end
- end
- end]]--
- function Totalpoints(twos, threes, fives)
- --table.sort(arenapoints)
- --GetInfo(twos, threes, fives)
- end
- function toggleaddon(self)
- if (ArenaCalculator:IsShown() == 1) then
- FarmModeCheckButton:SetChecked(FarmMode)
- ArenaCalculator:Hide()
- else
- FarmModeCheckButton:SetChecked(FarmMode)
- ArenaCalculator:Show()
- --arenatest()
- end
- end
- LooterLootTable = { "(.*)cloth", "(.*)Cloth", "Tiny Treasure Chest", "Azshara's Veil", "Cinderbloom", "Heartblossom", "Stormvine", "Twilight Jasmine", "Whiptail", "Embersilk Cloth", "Sealed Crate", "Volatile Fire", "Volatile Earth", "Volatile Water", "Volatile Air", "Volatile Life", "Obsidium Ore", "Heavy Savage Leather", "Elementium Ore", "Pyrite Ore", "Alicite", "Jasper", "Hessonite", "Zephyrite", "Carnelian", "Nightstone", "Amberjewel", "Ocean Sapphire", "Dream Emerald", "Demonseye", "Ember Topaz", "Inferno Ruby", "Shadowspirit Diamond", "Chimera's Eye", "Sticky Silk Gland", "Barrel of Southsea Rum", "Rustberg Seabass", "Stack of Cannonballs", "Siege Engine Scrap", "Cursed Femur", "Shipyard Lumber" }
- local frame = Looter
- frame:RegisterEvent("LOOT_OPENED")
- frame:SetScript("OnEvent", function(self, event, ...)
- FishingLooterAutoLoot(FarmMode)
- end)
- Looting = { };
- function FishingLooterAutoLoot(FarmMode)
- if (FarmMode == true) then
- table.wipe(Looting)
- if (GetNumLootItems() == 0) then
- CloseLoot()
- end
- for i = 1, GetNumLootItems() do
- link = GetLootSlotLink(i)
- texture, item, quantity, quality, locked, isquestitem, questID, isActive = GetLootSlotInfo(i)
- table.insert(Looting, link)
- if (LootSlotIsCoin(i) == 1) then LootSlot(i) end
- if (quality >= 2) and (locked ~= 1) then
- name, _, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(link)
- if (iLevel > 358) then LootSlot(i) end
- end
- if (isquestitem == true) then
- table.remove(Looting);
- print("|cffff00ffLooted: |r" ..link.. " |cffff00ffAmount: |r" ..quantity)
- discarded = false;
- LootSlot(i)
- end
- if (link) and (item) then
- for u,v in ipairs(LooterLootTable) do
- if (string.find(item, LooterLootTable[u])) then
- table.remove(Looting)
- LootSlot(i)
- print("|cffff00ffLooted: |r" ..link.. " |cffff00ffAmount: |r" ..quantity)
- end
- end
- end
- if (i == GetNumLootItems()) then
- discarded = table.concat(Looting, ", ")
- if (discarded ~= "") then
- print("|cff00ccffThe following item(s) were not looted: |r" ..discarded)
- end
- CloseLoot()
- end
- end
- end
- end
- if not Chat_Msg_Loot then
- Chat_Msg_Loot = CreateFrame("frame")
- end
- --[[local frame = Chat_Msg_Loot
- frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- frame:SetScript("OnEvent", function(self, event, ...)
- if (arg2 == "UNIT_DIED") then
- local name = Xzempt
- SendChatMessage(arg4.. " just killed me.", "WHISPER", nil, name)
- end
- end)]]--
- function GetAlts(msg, msg1)
- local total = GetNumGuildMembers()
- local count = 0
- guild = { }
- local x = 1
- local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(x);
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
- SetGuildRosterShowOffline(true)
- if msg1 and name then
- table.wipe(guild)
- for x = 1, total do
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
- if (string.match(string.lower(note), msg1)) then
- table.insert(guild, name)
- --SendChatMessage("Character Name: |cffff00ff" ..name.. "|r Rank: |cffff00ff" ..rank.. "|r Note: |cffff00ff" ..note.. "|r", "OFFICER")
- count = count + 1
- end
- if (count > 1) and (x == total) then
- local found = table.concat(guild, ", ")
- SendChatMessage("Found: " ..#guild.. " entries for \"" ..msg.. "\". Listing...", "OFFICER")
- SendChatMessage("|cffff00ff" ..found.. " |r", "OFFICER")
- end
- if (count == 0) and (x == total) then
- SendChatMessage("Nothing Found.", "OFFICER")
- end
- end
- end
- end
- --[[if (msg == "clean") then
- for x = 1, total do
- local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(x);
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
- if (daysOffline >= 15) or (monthsOffline >= 1) or (yearsOffline >= 1) and (x ~= total) then
- count = 1
- GuildUninvite(name)
- end
- if (count == 0) and (x == total) then
- print("Nothing Found...")
- end
- end
- end
- if (msg == "resetnotes") then
- for x = 1, total do
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(x)
- table.insert(guild, name)
- if (x == total) then
- print("Found: " ..#guild.. " entries")
- for x = 1, total do
- GuildRosterSetPublicNote(index, name)
- GuildRosterSetOfficerNote(index, name)
- end
- end
- end
- end]]--
- local timer = CreateFrame("Frame")
- timer:RegisterEvent("OnUpdate")
- function delay(delay, func)
- timer.func = func
- timer.delay = delay
- timer:Show()
- end
- timer:SetScript("OnUpdate", function(self, elapsed, msg)
- if running == true then
- timer.delay = timer.delay - elapsed
- if timer.delay <= 0 then
- timer:Hide()
- timer.func(msg1)
- end
- end
- end)
- local total = GetNumGuildMembers()
- function GatherData(msg1)
- local guildtotal = GetNumGuildMembers()
- if not index then index = 1 else index = index + 1 end
- if (index == guildtotal) then
- print("Script Completed Successfully.")
- running = false
- index = 0
- else
- --local index = index + 1
- local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile = GetGuildRosterInfo(index)
- if (name) then
- if (msg1 == "resetnotes") then
- print(name) --GuildRosterSetPublicNote(index, name)
- print(name) --GuildRosterSetOfficerNote(index, name)
- delay(1, GatherData)
- end
- if (msg1 == "clean") then
- local yearsOffline, monthsOffline, daysOffline, hoursOffline = GetGuildRosterLastOnline(index);
- if (daysOffline == nil) and (monthsOffline == nil) and (yearsOffline == nil) and (hoursOffline == nil) then
- print(name.. " is online now!")
- delay(1, GatherData)
- --end
- elseif (daysOffline >= 15) or (monthsOffline >= 1) or (yearsOffline >= 1) then
- count = 1
- print("Uninviting " ..name)
- delay(1, GatherData)
- else
- print(name.. " has been online recently!")
- delay(1, GatherData)
- end
- if (count == 0) and (index == guildtotal) then
- print("Nothing Found...")
- end
- end
- if (msg1 == "autob") then
- delayinminutes = delay / 60
- SendChatMessage("Don't forget to stay up to date on raid schedules on our website. Site: http://guerrillawarfare.biz |cffff00ffAuto Broadcast.|r( " ..delayinminutes.. " 5 minute delay)", "GUILD")
- delay(1200, GatherData)
- end
- else
- print("Name not found")
- end
- end
- end
- SLASH_gi1 = '/gi'
- function SlashCmdList.gi(msg, editbox)
- if (msg ~= "autob") and (msg ~= "clean") and (msg ~= "resetnotes") and (msg ~= string.lower("test")) then
- SendChatMessage("Searching for alts of " ..msg.. " ...", "OFFICER")
- msg1 = string.lower(msg)
- GetAlts(msg, msg1)
- end
- if (msg == string.lower("clean")) or (msg == string.lower("resetnotes")) or (msg == string.lower("autob")) then
- msg1 = string.lower(msg)
- running = true
- delay(1200, GatherData)
- else
- GetAlts(msg)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement