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, tooltipText = "|cFF00FFFFKick a mofo from the guild!" };
- 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
- 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 == "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)
- function toggleaddon(self)
- if (ArenaCalculator:IsShown() == 1) then
- FarmModeCheckButton:SetChecked(FarmMode)
- ArenaCalculator:Hide()
- else
- FarmModeCheckButton:SetChecked(FarmMode)
- ArenaCalculator:Show()
- --arenatest()
- end
- end
- LooterLootTable = { "(.*)cloth", "Frostweave Cloth", "%l%l%%sCloth", "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 == 4) 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
- 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")
- function delayed(delay, func)
- timer.func = func
- timer.delay = delay
- timer:Show()
- end
- timer:SetScript("OnUpdate", function(self, elapsed)
- if running == true then
- timer.delay = timer.delay - elapsed
- if timer.delay <= 0 then
- timer:Hide()
- timer.func(delay, msg1)
- end
- end
- end)
- local count = 0
- local Inactive = { }
- function GatherData(delay, msg1)
- SetGuildRosterShowOffline(true)
- local guildtotal = GetNumGuildMembers()
- local scm = SendChatMessage
- if not index then index = 1 else index = index + 1 end
- if (removing == true) and (count > 0) then
- local inactive = table.concat(Inactive, ", ")
- removed = table.remove(Inactive)
- GuildUninvite(removed)
- count = count - 1
- delayed(120, GatherData)
- else
- if (removing == true) and (count == 0) then
- scm(entries.. " characters removed. Script Completed Successfully.", "GUILD")
- running = false
- index = 0
- timer:SetScript("OnUpdate", nil)
- else
- delayed(120, GatherData)
- end
- end
- if (index == guildtotal) and (count > 0) then
- entries = #Inactive
- removing = true
- delayed(0, GatherData)
- end
- if (index == guildtotal) and (count == 0) then
- timer:SetScript("OnUpdate", nil)
- running = false
- index = 0
- else
- 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)
- print(name)
- delayed(1, GatherData)
- end
- if (msg1 == "clean") then
- local yearsOffline, monthsOffline, daysOffline, hoursOffline, minutes = GetGuildRosterLastOnline(index);
- if (daysOffline == nil) and (monthsOffline == nil) and (yearsOffline == nil) and (hoursOffline == nil) then
- delayed(0, GatherData)
- end
- if (daysOffline) or (monthsOffline) or (yearsOffline) or (hoursOffline) then
- if (name ~= "Pandi") and (hoursOffline == 0) or (monthsOffline >= 1) or (yearsOffline >= 1) then
- count = count + 1
- table.insert(Inactive, name)
- delayed(0, GatherData)
- else
- delayed(0, GatherData)
- end
- end
- if (count == 0) and (index == guildtotal) then
- print("Nothing Found...")
- end
- end
- if (msg1 == "autob") then
- delay = delay / 60
- print(delayed)
- --SendChatMessage("Don't forget to stay up to date on raid schedules on our website. Site: http://guerrillawarfare.biz |cffff00ffAuto Broadcast.|r( " ..delayed.. " minute delay)", "OFFICER")
- --delayed(5, GatherData)
- end
- 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
- delayed(3, GatherData)
- else
- GetAlts(msg)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement