This commit is contained in:
2024-08-24 22:45:28 +02:00
parent 91b04ec9c3
commit 054568b2e6
25 changed files with 1594 additions and 1594 deletions

View File

@@ -1,19 +1,19 @@
function() function()
results = C_AuctionHouse.GetBrowseResults() results = C_AuctionHouse.GetBrowseResults()
-- DevTools_Dump(results) -- DevTools_Dump(results)
for k,v in ipairs(results) do for k,v in ipairs(results) do
local itemID = v.itemKey.itemID local itemID = v.itemKey.itemID
local itemName = GetItemInfo(itemID) local itemName = GetItemInfo(itemID)
if aura_env.sellPriceThresholds[itemID] then if aura_env.sellPriceThresholds[itemID] then
if v.minPrice > aura_env.sellPriceThresholds[itemID] then if v.minPrice > aura_env.sellPriceThresholds[itemID] then
print(itemName, "too expensive") print(itemName, "too expensive")
SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) SendChatMessage("POKE", "WHISPER", nil, UnitName("player"))
end end
elseif aura_env.buyPriceThresholds[itemID] then elseif aura_env.buyPriceThresholds[itemID] then
if v.minPrice < aura_env.buyPriceThresholds[itemID] then if v.minPrice < aura_env.buyPriceThresholds[itemID] then
print(itemName, "too cheap") print(itemName, "too cheap")
SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) SendChatMessage("POKE", "WHISPER", nil, UnitName("player"))
end end
end end
end end
end end

View File

@@ -1,6 +1,6 @@
function() function()
if not aura_env.last or aura_env.last < GetTime() - aura_env.throttleTime then if not aura_env.last or aura_env.last < GetTime() - aura_env.throttleTime then
aura_env.last = GetTime() aura_env.last = GetTime()
AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click()
end end
end end

View File

@@ -1,17 +1,17 @@
aura_env.throttleTime = 10 aura_env.throttleTime = 10
aura_env.sellPriceThresholds = { aura_env.sellPriceThresholds = {
[168446] = 5000 * 100 * 100; -- Accord of Critical Strike [168446] = 5000 * 100 * 100; -- Accord of Critical Strike
[168447] = 5000 * 100 * 100; -- Accord of Haste [168447] = 5000 * 100 * 100; -- Accord of Haste
[168448] = 5000 * 100 * 100; -- Accord of Mastery [168448] = 5000 * 100 * 100; -- Accord of Mastery
[168449] = 5000 * 100 * 100; -- Accord of Versatility [168449] = 5000 * 100 * 100; -- Accord of Versatility
[168592] = 4500 * 100 * 100; -- Oceanic Restoration [168592] = 4500 * 100 * 100; -- Oceanic Restoration
[168496] = 4500 * 100 * 100; -- Force Multiplier [168496] = 4500 * 100 * 100; -- Force Multiplier
[168593] = 4500 * 100 * 100; -- Machinist's Brilliance [168593] = 4500 * 100 * 100; -- Machinist's Brilliance
[168598] = 4500 * 100 * 100; -- Naga Hide [168598] = 4500 * 100 * 100; -- Naga Hide
} }
aura_env.buyPriceThresholds = { aura_env.buyPriceThresholds = {
[152576] = 5 * 100 * 100; -- Tidesrpay Linen [152576] = 5 * 100 * 100; -- Tidesrpay Linen
[152877] = 500 * 100 * 100; -- Veiled Crystal [152877] = 500 * 100 * 100; -- Veiled Crystal
} }

View File

@@ -1,3 +1,3 @@
/run AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() /run AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click()
/dump C_AuctionHouse.GetBrowseResults() /dump C_AuctionHouse.GetBrowseResults()

View File

@@ -1,205 +1,205 @@
--- LOOT_READY LOOT_OPENED MERCHANT_SHOW QUEST_POI_UPDATE QUEST_DETAIL QUEST_COMPLETE QUEST_GREETING QUEST_PROGRESS GOSSIP_SHOW SCRAPPING_MACHINE_SHOW MERCHANT_CLOSED EQUIP_BIND_CONFIRM --- LOOT_READY LOOT_OPENED MERCHANT_SHOW QUEST_POI_UPDATE QUEST_DETAIL QUEST_COMPLETE QUEST_GREETING QUEST_PROGRESS GOSSIP_SHOW SCRAPPING_MACHINE_SHOW MERCHANT_CLOSED EQUIP_BIND_CONFIRM
function(e) function(e)
local aura_env = aura_env local aura_env = aura_env
if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot
local slot = 1 local slot = 1
local lootinfo = GetLootInfo() local lootinfo = GetLootInfo()
for k, v in pairs(lootinfo) do for k, v in pairs(lootinfo) do
if v.locked == false then if v.locked == false then
local link = GetLootSlotLink(slot) local link = GetLootSlotLink(slot)
local looted = false local looted = false
if not link then link = GetLootSlotLink(slot) end if not link then link = GetLootSlotLink(slot) end
if aura_env.filter[1] == true and (v.item:match("%d+ Gold") or v.item:match("%d+ Silver") or v.item:match("%d+ Copper")) then if aura_env.filter[1] == true and (v.item:match("%d+ Gold") or v.item:match("%d+ Silver") or v.item:match("%d+ Copper")) then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[2] == true and link:match("Azerite") then elseif aura_env.filter[2] == true and link:match("Azerite") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[3] == true and v.item:match("War Resources") then elseif aura_env.filter[3] == true and v.item:match("War Resources") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[4] == true and v.item:match("Residuum") then elseif aura_env.filter[4] == true and v.item:match("Residuum") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[5] == true and v.item:match("Manapearl") then elseif aura_env.filter[5] == true and v.item:match("Manapearl") then
LootSlot(slot) LootSlot(slot)
end end
if link then if link then
local icon = v.texture local icon = v.texture
local id = link:match("item:(%d+):") local id = link:match("item:(%d+):")
local type = select(6, GetItemInfo(link)) or "" local type = select(6, GetItemInfo(link)) or ""
local subtype = select(7, GetItemInfo(link)) or "" local subtype = select(7, GetItemInfo(link)) or ""
local ilvl = select(4, GetItemInfo(link)) or 0 local ilvl = select(4, GetItemInfo(link)) or 0
local equip = select(9, GetItemInfo(link)) local equip = select(9, GetItemInfo(link))
if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[14] == true and v.isQuestItem == true then elseif aura_env.filter[14] == true and v.isQuestItem == true then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[15] == true and v.quality == 0 then elseif aura_env.filter[15] == true and v.quality == 0 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then
LootSlot(slot) LootSlot(slot)
else else
if type == "Weapon" or type == "Armor" then if type == "Weapon" or type == "Armor" then
if aura_env.filter[18] == true and aura_env.skills[select(3, UnitClass("player"))][subtype] == 1 and v.quality > 2 then if aura_env.filter[18] == true and aura_env.skills[select(3, UnitClass("player"))][subtype] == 1 and v.quality > 2 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[19] == true and (equip == "INVTYPE_FINGER" or equip == "INVTYPE_TRINKET" or equip == "INVTYPE_CLOAK" or equip == "INVTYPE_NECK") and v.quality > 2 then elseif aura_env.filter[19] == true and (equip == "INVTYPE_FINGER" or equip == "INVTYPE_TRINKET" or equip == "INVTYPE_CLOAK" or equip == "INVTYPE_NECK") and v.quality > 2 then
LootSlot(slot) LootSlot(slot)
end end
elseif aura_env.filter[20] == true and type == "Miscellaneous" then elseif aura_env.filter[20] == true and type == "Miscellaneous" then
if subtype == "Mount" then if subtype == "Mount" then
LootSlot(slot) LootSlot(slot)
end end
end end
end end
end end
slot = slot + 1 slot = slot + 1
end end
end end
--CloseLoot() --CloseLoot()
elseif e == "EQUIP_BIND_CONFIRM" then elseif e == "EQUIP_BIND_CONFIRM" then
StaticPopup1Button1:Click() StaticPopup1Button1:Click()
elseif e == "SCRAPPING_MACHINE_SHOW" then elseif e == "SCRAPPING_MACHINE_SHOW" then
for i = 0, 4 do for i = 0, 4 do
for j = 1, GetContainerNumSlots(i) do for j = 1, GetContainerNumSlots(i) do
local link = select(7, GetContainerItemInfo(i, j)) local link = select(7, GetContainerItemInfo(i, j))
if link then if link then
local name = GetItemInfo(link) local name = GetItemInfo(link)
local rarity = select(3, GetItemInfo(link)) local rarity = select(3, GetItemInfo(link))
local ilvl = select(4, GetItemInfo(link)) or 0 local ilvl = select(4, GetItemInfo(link)) or 0
local type = select(6, GetItemInfo(link)) local type = select(6, GetItemInfo(link))
local equip = select(9, GetItemInfo(link)) or "" local equip = select(9, GetItemInfo(link)) or ""
local price = select(11, GetItemInfo(link)) local price = select(11, GetItemInfo(link))
if aura_env.sellWhitelist[name] ~= 1 then if aura_env.sellWhitelist[name] ~= 1 then
if name and rarity and ilvl and type and equip and price then if name and rarity and ilvl and type and equip and price then
if (type == "Armor" or type == "Weapon") and rarity <= 3 and aura_env.getequipID(equip) then if (type == "Armor" or type == "Weapon") and rarity <= 3 and aura_env.getequipID(equip) then
UseContainerItem(i, j) UseContainerItem(i, j)
elseif rarity > 3 and aura_env.getequipID(equip) then elseif rarity > 3 and aura_env.getequipID(equip) then
if equip ~= "INVTYPE_FINGER" then if equip ~= "INVTYPE_FINGER" then
local eqID = aura_env.getequipID(equip) local eqID = aura_env.getequipID(equip)
local elink = GetInventoryItemLink("player", eqID) local elink = GetInventoryItemLink("player", eqID)
local eilvl = select(4, GetItemInfo(elink)) or 0 local eilvl = select(4, GetItemInfo(elink)) or 0
if eilvl > ilvl + 5 then if eilvl > ilvl + 5 then
print("Scrapping " .. link .. "over " .. eilvl - ilvl .. " ilvl difference from " .. elink) print("Scrapping " .. link .. "over " .. eilvl - ilvl .. " ilvl difference from " .. elink)
UseContainerItem(i, j) UseContainerItem(i, j)
end end
elseif equip == "INVTYPE_FINGER" then elseif equip == "INVTYPE_FINGER" then
local eqID1, eqID2 = 11, 12 local eqID1, eqID2 = 11, 12
local elink1, elink2 = GetInventoryItemLink("player", eqID1), GetInventoryItemLink("player", eqID2) local elink1, elink2 = GetInventoryItemLink("player", eqID1), GetInventoryItemLink("player", eqID2)
local eilvl1, eilvl2 = select(4, GetItemInfo(elink1)) or 0, select(4, GetItemInfo(elink2)) or 0 local eilvl1, eilvl2 = select(4, GetItemInfo(elink1)) or 0, select(4, GetItemInfo(elink2)) or 0
if eilvl1 > ilvl + 5 then if eilvl1 > ilvl + 5 then
print("Scrapping " .. link .. " over " .. eilvl1 - ilvl .. " ilvl difference from " .. elink1) print("Scrapping " .. link .. " over " .. eilvl1 - ilvl .. " ilvl difference from " .. elink1)
UseContainerItem(i, j) UseContainerItem(i, j)
elseif eilvl2 > ilvl + 5 then elseif eilvl2 > ilvl + 5 then
print("Scrapping " .. link .. " over " .. eilvl2 - ilvl .. " ilvl difference from " .. elink2) print("Scrapping " .. link .. " over " .. eilvl2 - ilvl .. " ilvl difference from " .. elink2)
UseContainerItem(i, j) UseContainerItem(i, j)
end end
end end
end end
end end
end end
end end
end end
end end
elseif e == "MERCHANT_SHOW" then --Sell grey and white wepaon elseif e == "MERCHANT_SHOW" then --Sell grey and white wepaon
if CanMerchantRepair() == true then RepairAllItems() end if CanMerchantRepair() == true then RepairAllItems() end
local i, j = 0, 1 local i, j = 0, 1
for c = 0, 4 do for c = 0, 4 do
for s = 1, GetContainerNumSlots(c) do for s = 1, GetContainerNumSlots(c) do
local link = select(7, GetContainerItemInfo(c, s)) local link = select(7, GetContainerItemInfo(c, s))
if link then if link then
local name = GetItemInfo(link) local name = GetItemInfo(link)
local rarity = select(3, GetItemInfo(link)) local rarity = select(3, GetItemInfo(link))
local ilvl = select(4, GetItemInfo(link)) or 0 local ilvl = select(4, GetItemInfo(link)) or 0
local type = select(6, GetItemInfo(link)) local type = select(6, GetItemInfo(link))
local price = select(11, GetItemInfo(link)) local price = select(11, GetItemInfo(link))
if price and price > 0 then if price and price > 0 then
if aura_env.sellWhitelist[name] ~= 1 then if aura_env.sellWhitelist[name] ~= 1 then
if rarity == 0 then if rarity == 0 then
if aura_env.throttleSell == true then if aura_env.throttleSell == true then
aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s}
else else
UseContainerItem(c, s) UseContainerItem(c, s)
end end
elseif (type == "Armor" or type == "Weapon") and ilvl < 200 then elseif (type == "Armor" or type == "Weapon") and ilvl < 200 then
if aura_env.throttleSell == true then if aura_env.throttleSell == true then
aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s}
else else
UseContainerItem(c, s) UseContainerItem(c, s)
end end
end end
end end
end end
end end
end end
end end
if aura_env.throttleSell == true then if aura_env.throttleSell == true then
aura_env.ticker = C_Timer.NewTicker(0.05, function() aura_env.ticker = C_Timer.NewTicker(0.05, function()
if aura_env.toSell[1] then if aura_env.toSell[1] then
UseContainerItem(aura_env.toSell[1].c, aura_env.toSell[1].s) UseContainerItem(aura_env.toSell[1].c, aura_env.toSell[1].s)
table.remove(aura_env.toSell, 1) table.remove(aura_env.toSell, 1)
else else
aura_env.ticker:Cancel() aura_env.ticker:Cancel()
end end
if j >= GetContainerNumSlots(i) then i = i + 1 if j >= GetContainerNumSlots(i) then i = i + 1
j = 1 end j = 1 end
if i >= 4 then aura_env.ticker:Cancel() end if i >= 4 then aura_env.ticker:Cancel() end
end) end)
end end
elseif e == "MERCHANT_CLOSED" then elseif e == "MERCHANT_CLOSED" then
if aura_env.ticker then aura_env.ticker:Cancel() end if aura_env.ticker then aura_env.ticker:Cancel() end
aura_env.toSell = {} aura_env.toSell = {}
elseif e == "QUEST_POI_UPDATE" then elseif e == "QUEST_POI_UPDATE" then
CloseGossip() CloseGossip()
elseif e == "QUEST_DETAIL" then elseif e == "QUEST_DETAIL" then
AcceptQuest() AcceptQuest()
elseif e == "QUEST_COMPLETE" then elseif e == "QUEST_COMPLETE" then
if GetNumQuestChoices() <= 1 then if GetNumQuestChoices() <= 1 then
GetQuestReward(1) GetQuestReward(1)
end end
elseif e == "GOSSIP_SHOW" then elseif e == "GOSSIP_SHOW" then
local quests = GetNumGossipAvailableQuests() local quests = GetNumGossipAvailableQuests()
local complquests = GetNumGossipActiveQuests() local complquests = GetNumGossipActiveQuests()
local opt = GetNumGossipOptions() local opt = GetNumGossipOptions()
if complquests > 0 and opt == 0 then if complquests > 0 and opt == 0 then
for i = 1, complquests do for i = 1, complquests do
SelectGossipActiveQuest(i) SelectGossipActiveQuest(i)
end end
end end
if quests > 0 and opt == 0 then if quests > 0 and opt == 0 then
SelectGossipAvailableQuest(1) SelectGossipAvailableQuest(1)
end end
if opt == 1 and quests + complquests == 0 then if opt == 1 and quests + complquests == 0 then
SelectGossipOption(1) SelectGossipOption(1)
end end
elseif e == "QUEST_GREETING" then elseif e == "QUEST_GREETING" then
local quests = GetNumGossipAvailableQuests() local quests = GetNumGossipAvailableQuests()
local complquests = GetNumGossipActiveQuests() local complquests = GetNumGossipActiveQuests()
if complquests > 0 then if complquests > 0 then
for i = 1, complquests do for i = 1, complquests do
SelectActiveQuest(1) SelectActiveQuest(1)
end end
end end
if quests > 0 then if quests > 0 then
SelectAvailableQuest(1) SelectAvailableQuest(1)
end end
elseif e == "QUEST_PROGRESS" then elseif e == "QUEST_PROGRESS" then
if IsQuestCompletable(i) then if IsQuestCompletable(i) then
CompleteQuest() CompleteQuest()
end end
end end
end end

View File

@@ -1,380 +1,380 @@
aura_env.debug = true aura_env.debug = true
aura_env.filter = { aura_env.filter = {
[1] = true, --Gold [1] = true, --Gold
[2] = true, --Azerite [2] = true, --Azerite
[3] = true, --War resources [3] = true, --War resources
[4] = true, --Residuum [4] = true, --Residuum
[5] = true, --Manapearls [5] = true, --Manapearls
[6] = true, --Mounts [6] = true, --Mounts
[7] = true, --High ilvl [7] = true, --High ilvl
[8] = false, --Herbs [8] = false, --Herbs
[9] = true, --Cooking [9] = true, --Cooking
[10] = true, --Cloth [10] = true, --Cloth
[11] = false, --Metal & Stone [11] = false, --Metal & Stone
[12] = true, --Gold filter greys [12] = true, --Gold filter greys
[13] = true, -- >1 && <4 quality items, no gear [13] = true, -- >1 && <4 quality items, no gear
[14] = true, --Quest items [14] = true, --Quest items
[15] = true, --All greys [15] = true, --All greys
[16] = true, --Whitelist [16] = true, --Whitelist
[17] = true, --Quest items (different filter) [17] = true, --Quest items (different filter)
[18] = true, --Class aproperiate >2 items [18] = true, --Class aproperiate >2 items
[19] = true, --Jewelery >2 quality [19] = true, --Jewelery >2 quality
[20] = true, --Additional mount filter [20] = true, --Additional mount filter
[21] = true, --Tradeskill // Elemental [21] = true, --Tradeskill // Elemental
} }
aura_env.ilvlFilter = 200 aura_env.ilvlFilter = 200
aura_env.goldFilter = 0.5 aura_env.goldFilter = 0.5
aura_env.goldFilter = aura_env.goldFilter * 10000 aura_env.goldFilter = aura_env.goldFilter * 10000
aura_env.throttleSell = false aura_env.throttleSell = false
aura_env.whitelist = { aura_env.whitelist = {
["Pygmy Suckerfish"] = 1, ["Pygmy Suckerfish"] = 1,
["Drakkari Offerings"] = 1, ["Drakkari Offerings"] = 1,
["Deepcoral Pod"] = 1, ["Deepcoral Pod"] = 1,
["Hardened Spring"] = 1, ["Hardened Spring"] = 1,
["Machined Gear Assembly"] = 1, ["Machined Gear Assembly"] = 1,
["Tempered Plating"] = 1, ["Tempered Plating"] = 1,
["Hefty Glimmershell"] = 1, ["Hefty Glimmershell"] = 1,
["Fresh Meat"] = 1, ["Fresh Meat"] = 1,
["Wood"] = 1, ["Wood"] = 1,
["Gloom Dust"] = 1, ["Gloom Dust"] = 1,
["Veiled Crytal"] = 1, ["Veiled Crytal"] = 1,
["Coalescing Visions"] = 1, ["Coalescing Visions"] = 1,
["Echoes of Ny'alotha"] = 1, ["Echoes of Ny'alotha"] = 1,
["Corrupted Mementos"] = 1, ["Corrupted Mementos"] = 1,
["Blood of Sargeras"] = 1, ["Blood of Sargeras"] = 1,
["Primal Sargerite"] = 1, ["Primal Sargerite"] = 1,
["Chain Ignitercoil"] = 1, ["Chain Ignitercoil"] = 1,
["Galvanic Oscillator"] = 1, ["Galvanic Oscillator"] = 1,
["Corrupted Memento"] = 1, ["Corrupted Memento"] = 1,
} }
aura_env.sellWhitelist = { aura_env.sellWhitelist = {
["Blacksmith Hammer"] = 1, ["Blacksmith Hammer"] = 1,
["Endless Tincture of Renewed Combat"] = 1, ["Endless Tincture of Renewed Combat"] = 1,
["Mr. Munchykins"] = 1, ["Mr. Munchykins"] = 1,
["Arclight Spanner"] = 1, ["Arclight Spanner"] = 1,
["Runeblade of Baron Rivendare"] = 1, ["Runeblade of Baron Rivendare"] = 1,
} }
aura_env.toSell = {} aura_env.toSell = {}
aura_env.getequipID = function(equip) aura_env.getequipID = function(equip)
if equip == "INVTYPE_HEAD" then return 1 if equip == "INVTYPE_HEAD" then return 1
elseif equip == "INVTYPE_NECK" then return 2 elseif equip == "INVTYPE_NECK" then return 2
elseif equip == "INVTYPE_SHOULDER" then return 3 elseif equip == "INVTYPE_SHOULDER" then return 3
elseif equip == "INVTYPE_BODY" then return 4 elseif equip == "INVTYPE_BODY" then return 4
elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5 elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5
elseif equip == "INVTYPE_WAIST" then return 6 elseif equip == "INVTYPE_WAIST" then return 6
elseif equip == "INVTYPE_LEGS" then return 7 elseif equip == "INVTYPE_LEGS" then return 7
elseif equip == "INVTYPE_FEET" then return 8 elseif equip == "INVTYPE_FEET" then return 8
elseif equip == "INVTYPE_WRIST" then return 9 elseif equip == "INVTYPE_WRIST" then return 9
elseif equip == "INVTYPE_HAND" then return 10 elseif equip == "INVTYPE_HAND" then return 10
elseif equip == "INVTYPE_CLOAK" then return 15 elseif equip == "INVTYPE_CLOAK" then return 15
elseif equip == "INVTYPE_WEAPON" or equip == "INVTYPE_WEAPONMAINHAND" or equip == "INVTYPE_2HWEAPON" then return 16 elseif equip == "INVTYPE_WEAPON" or equip == "INVTYPE_WEAPONMAINHAND" or equip == "INVTYPE_2HWEAPON" then return 16
elseif equip == "INVTYPE_SHIELD" then return 17 elseif equip == "INVTYPE_SHIELD" then return 17
else return nil end else return nil end
end end
aura_env.skills = { aura_env.skills = {
--Warrior --Warrior
[1] = { [1] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 1, ["Plate"] = 1,
["Shields"] = 1, ["Shields"] = 1,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 1, ["Two-Handed Axes"] = 1,
["Bows"] = 1, ["Bows"] = 1,
["Guns"] = 1, ["Guns"] = 1,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 1, ["Two-Handed Maces"] = 1,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 1, ["Two-Handed Swords"] = 1,
["Warglaives"] = 1, ["Warglaives"] = 1,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 1, ["Crossbows"] = 1,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Paladin --Paladin
[2] = { [2] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 1, ["Plate"] = 1,
["Shields"] = 1, ["Shields"] = 1,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 1, ["Two-Handed Axes"] = 1,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 1, ["Two-Handed Maces"] = 1,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 1, ["Two-Handed Swords"] = 1,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 0, ["Staves"] = 0,
["Fist Weapons"] = 0, ["Fist Weapons"] = 0,
["Daggers"] = 0, ["Daggers"] = 0,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Hunter --Hunter
[3] = { [3] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 1, ["Mail"] = 1,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 1, ["Two-Handed Axes"] = 1,
["Bows"] = 1, ["Bows"] = 1,
["Guns"] = 1, ["Guns"] = 1,
["One-Handed Maces"] = 0, ["One-Handed Maces"] = 0,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 1, ["Two-Handed Swords"] = 1,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 1, ["Crossbows"] = 1,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Rogue --Rogue
[4] = { [4] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 1, ["Leather"] = 1,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 0, ["Staves"] = 0,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Priest --Priest
[5] = { [5] = {
--Armor Skills --Armor Skills
["Cloth"] = 1, ["Cloth"] = 1,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 0, ["One-Handed Axes"] = 0,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 0, ["One-Handed Swords"] = 0,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 0, ["Fist Weapons"] = 0,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 1, ["Wands"] = 1,
}, },
--Death Knight --Death Knight
[6] = { [6] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 1, ["Plate"] = 1,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 1, ["Two-Handed Axes"] = 1,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 1, ["Two-Handed Maces"] = 1,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 1, ["Two-Handed Swords"] = 1,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 0, ["Staves"] = 0,
["Fist Weapons"] = 0, ["Fist Weapons"] = 0,
["Daggers"] = 0, ["Daggers"] = 0,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Shaman --Shaman
[7] = { [7] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 1, ["Mail"] = 1,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 1, ["Shields"] = 1,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 0, ["One-Handed Swords"] = 0,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Mage --Mage
[8] = { [8] = {
--Armor Skills --Armor Skills
["Cloth"] = 1, ["Cloth"] = 1,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 0, ["One-Handed Axes"] = 0,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 0, ["One-Handed Maces"] = 0,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 0, ["Fist Weapons"] = 0,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 1, ["Wands"] = 1,
}, },
--Warlock --Warlock
[9] = { [9] = {
--Armor Skills --Armor Skills
["Cloth"] = 1, ["Cloth"] = 1,
["Leather"] = 0, ["Leather"] = 0,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 0, ["One-Handed Axes"] = 0,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 0, ["One-Handed Maces"] = 0,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 0, ["Fist Weapons"] = 0,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 1, ["Wands"] = 1,
}, },
--Monk --Monk
[10] = { [10] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 1, ["Leather"] = 1,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 1, ["Plate"] = 1,
["Shields"] = 1, ["Shields"] = 1,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 0, ["Daggers"] = 0,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Druid --Druid
[11] = { [11] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 1, ["Leather"] = 1,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 0, ["One-Handed Axes"] = 0,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 1, ["One-Handed Maces"] = 1,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 1, ["Polearms"] = 1,
["One-Handed Swords"] = 0, ["One-Handed Swords"] = 0,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 0, ["Warglaives"] = 0,
["Staves"] = 1, ["Staves"] = 1,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 1, ["Daggers"] = 1,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
--Demon Hunter --Demon Hunter
[12] = { [12] = {
--Armor Skills --Armor Skills
["Cloth"] = 0, ["Cloth"] = 0,
["Leather"] = 1, ["Leather"] = 1,
["Mail"] = 0, ["Mail"] = 0,
["Plate"] = 0, ["Plate"] = 0,
["Shields"] = 0, ["Shields"] = 0,
--Weapon Skills --Weapon Skills
["One-Handed Axes"] = 1, ["One-Handed Axes"] = 1,
["Two-Handed Axes"] = 0, ["Two-Handed Axes"] = 0,
["Bows"] = 0, ["Bows"] = 0,
["Guns"] = 0, ["Guns"] = 0,
["One-Handed Maces"] = 0, ["One-Handed Maces"] = 0,
["Two-Handed Maces"] = 0, ["Two-Handed Maces"] = 0,
["Polearms"] = 0, ["Polearms"] = 0,
["One-Handed Swords"] = 1, ["One-Handed Swords"] = 1,
["Two-Handed Swords"] = 0, ["Two-Handed Swords"] = 0,
["Warglaives"] = 1, ["Warglaives"] = 1,
["Staves"] = 0, ["Staves"] = 0,
["Fist Weapons"] = 1, ["Fist Weapons"] = 1,
["Daggers"] = 0, ["Daggers"] = 0,
["Crossbows"] = 0, ["Crossbows"] = 0,
["Wands"] = 0, ["Wands"] = 0,
}, },
} }

View File

@@ -1,69 +1,69 @@
-- LOOT_READY LOOT_OPENED -- LOOT_READY LOOT_OPENED
function(e, ...) function(e, ...)
local slot = 1 local slot = 1
local lootinfo = GetLootInfo() local lootinfo = GetLootInfo()
for k, v in pairs(lootinfo) do for k, v in pairs(lootinfo) do
if v.locked == false then if v.locked == false then
local link = GetLootSlotLink(slot) local link = GetLootSlotLink(slot)
if not link then link = GetLootSlotLink(slot) end if not link then link = GetLootSlotLink(slot) end
if aura_env.filter[1] == true and (v.item:match("%d+ Gold") or v.item:match("%d+ Silver") or v.item:match("%d+ Copper")) then if aura_env.filter[1] == true and (v.item:match("%d+ Gold") or v.item:match("%d+ Silver") or v.item:match("%d+ Copper")) then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[2] == true and link:match("Azerite") then elseif aura_env.filter[2] == true and link:match("Azerite") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[3] == true and v.item:match("War Resources") then elseif aura_env.filter[3] == true and v.item:match("War Resources") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[4] == true and v.item:match("Residuum") then elseif aura_env.filter[4] == true and v.item:match("Residuum") then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[5] == true and v.item:match("Manapearl") then elseif aura_env.filter[5] == true and v.item:match("Manapearl") then
LootSlot(slot) LootSlot(slot)
end end
if link then if link then
local type = select(6, GetItemInfo(link)) or "" local type = select(6, GetItemInfo(link)) or ""
local subtype = select(7, GetItemInfo(link)) or "" local subtype = select(7, GetItemInfo(link)) or ""
local ilvl = select(4, GetItemInfo(link)) or 0 local ilvl = select(4, GetItemInfo(link)) or 0
local equip = select(9, GetItemInfo(link)) local equip = select(9, GetItemInfo(link))
if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[14] == true and v.isQuestItem == true then elseif aura_env.filter[14] == true and v.isQuestItem == true then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[15] == true and v.quality == 0 then elseif aura_env.filter[15] == true and v.quality == 0 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then
LootSlot(slot) LootSlot(slot)
else else
if type == "Weapon" or type == "Armor" then if type == "Weapon" or type == "Armor" then
if aura_env.filter[18] == true and aura_env.skills[select(3, UnitClass("player"))][subtype] == 1 and v.quality > 2 then if aura_env.filter[18] == true and aura_env.skills[select(3, UnitClass("player"))][subtype] == 1 and v.quality > 2 then
LootSlot(slot) LootSlot(slot)
elseif aura_env.filter[19] == true and (equip == "INVTYPE_FINGER" or equip == "INVTYPE_TRINKET" or equip == "INVTYPE_CLOAK" or equip == "INVTYPE_NECK") and v.quality > 2 then elseif aura_env.filter[19] == true and (equip == "INVTYPE_FINGER" or equip == "INVTYPE_TRINKET" or equip == "INVTYPE_CLOAK" or equip == "INVTYPE_NECK") and v.quality > 2 then
LootSlot(slot) LootSlot(slot)
end end
elseif aura_env.filter[20] == true and type == "Miscellaneous" then elseif aura_env.filter[20] == true and type == "Miscellaneous" then
if subtype == "Mount" then if subtype == "Mount" then
LootSlot(slot) LootSlot(slot)
end end
end end
end end
end end
slot = slot + 1 slot = slot + 1
end end
end end
end end

View File

@@ -1,20 +1,20 @@
{ {
IsOnCooldown = { IsOnCooldown = {
type = "bool", type = "bool",
test = function(state, needle) test = function(state, needle)
return state.IsOnCooldown == (needle == 1) return state.IsOnCooldown == (needle == 1)
end, end,
}, },
IsActive = { IsActive = {
type = "bool", type = "bool",
test = function(state, needle) test = function(state, needle)
return state.IsActive == (needle == 1) return state.IsActive == (needle == 1)
end, end,
}, },
IsDebuff = { IsDebuff = {
type = "bool", type = "bool",
test = function(state, needle) test = function(state, needle)
return state.IsBad == (needle == 1) return state.IsBad == (needle == 1)
end, end,
}, },
} }

View File

@@ -1,11 +1,11 @@
function() function()
if aura_env.state.pname then if aura_env.statee.pname then
output = "" output = ""
if aura_env.state.pclass then if aura_env.statee.pclass then
output = aura_env.GetClassColor(aura_env.state.pclass) .. aura_env.state.pname .. "\124r" output = aura_env.GetClassColor(aura_env.statee.pclass) .. aura_env.statee.pname .. "\124r"
else else
output = aura_env.state.pname output = aura_env.statee.pname
end end
return output return output
end end
end end

View File

@@ -1,308 +1,308 @@
local function StrSplit(inputString, separator) local function StrSplit(inputString, separator)
local outputTable = {} local outputTable = {}
for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do
outputTable[#outputTable + 1] = str outputTable[#outputTable + 1] = str
end end
return outputTable return outputTable
end end
local function PrintTable(table) local function PrintTable(table)
for k,v in pairs(table) do for k,v in pairs(table) do
print(k .. " " .. v) print(k .. " " .. v)
end end
end end
aura_env.GetClassColor = function(class) aura_env.GetClassColor = function(class)
if class == "Death Knight" then if class == "Death Knight" then
return "\124cFFC41E3A" return "\124cFFC41E3A"
elseif class == "Druid" then elseif class == "Druid" then
return "\124cFFFF7C0A" return "\124cFFFF7C0A"
elseif class == "Hunter" then elseif class == "Hunter" then
return "\124cFFAAD372" return "\124cFFAAD372"
elseif class == "Mage" then elseif class == "Mage" then
return "\124cFF3FC7EB" return "\124cFF3FC7EB"
elseif class == "Paladin" then elseif class == "Paladin" then
return "\124cFFF48CBA" return "\124cFFF48CBA"
elseif class == "Priest" then elseif class == "Priest" then
return "\124cFFFFFFFF" return "\124cFFFFFFFF"
elseif class == "Rogue" then elseif class == "Rogue" then
return "\124cFFFFF468" return "\124cFFFFF468"
elseif class == "Shaman" then elseif class == "Shaman" then
return "\124cFF0070DD" return "\124cFF0070DD"
elseif class == "Warlock" then elseif class == "Warlock" then
return "\124cFF8788EE" return "\124cFF8788EE"
elseif class == "Warrior" then elseif class == "Warrior" then
return "\124cFFC69B6D" return "\124cFFC69B6D"
end end
end end
local Unit = { local Unit = {
New = function(self, unit) New = function(self, unit)
o = { o = {
["unit"] = unit, ["unit"] = unit,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
GetAuras = function(self, auraFunc, name, type) GetAuras = function(self, auraFunc, name, type)
return nil return nil
end, end,
} }
local BasicUnit = Unit:New("player") local BasicUnit = Unit:New("player")
function BasicUnit:GetAuras(auraFunc, name) function BasicUnit:GetAuras(auraFunc, name)
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name)
if aura ~= nil then if aura ~= nil then
return { return {
[UnitName(self.unit)] = { [UnitName(self.unit)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
} }
else else
return {} return {}
end end
end end
-- Maybe implement some sort of throttle to group unit? -- Maybe implement some sort of throttle to group unit?
local GroupUnit = Unit:New("group") local GroupUnit = Unit:New("group")
function GroupUnit:GetAuras(auraFunc, name) function GroupUnit:GetAuras(auraFunc, name)
local raidMem = GetNumRaidMembers() local raidMem = GetNumRaidMembers()
local num = GetNumPartyMembers() local num = GetNumPartyMembers()
local unitPrefix = "party" local unitPrefix = "party"
if raidMem > num then if raidMem > num then
unitPrefix = "raid" unitPrefix = "raid"
num = raidMem num = raidMem
end end
auras = {} auras = {}
for i = 1, num do for i = 1, num do
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name)
if aura ~= nil then if aura ~= nil then
auras[UnitName(unitPrefix .. i)] = { auras[UnitName(unitPrefix .. i)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["class"] = UnitClass(unitPrefix .. i) or "Paladin", ["class"] = UnitClass(unitPrefix .. i) or "Paladin",
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
if unitPrefix == "party" then if unitPrefix == "party" then
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name)
if aura ~= nil then if aura ~= nil then
auras[UnitName("player")] = { auras[UnitName("player")] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["class"] = UnitClass(unitPrefix .. i) or "Paladin", ["class"] = UnitClass(unitPrefix .. i) or "Paladin",
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
return auras return auras
end end
-- Nameplate does not work, find out why? -- Nameplate does not work, find out why?
local NameplateUnit = Unit:New("nameplate") local NameplateUnit = Unit:New("nameplate")
function NameplateUnit:GetAuras(auraFunc, name) function NameplateUnit:GetAuras(auraFunc, name)
local unitPrefix = "nameplate" local unitPrefix = "nameplate"
auras = {} auras = {}
for i = 1, 40 do for i = 1, 40 do
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name)
if aura ~= nil then if aura ~= nil then
auras[UnitName(unitPrefix .. i)] = { auras[UnitName(unitPrefix .. i)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
return auras return auras
end end
local UnitFactory = { local UnitFactory = {
New = function(self) New = function(self)
o = {} o = {}
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
CreateUnit = function(self, target) CreateUnit = function(self, target)
target = string.lower(target) target = string.lower(target)
if target == "player" or target == "target" or target == "focus" then if target == "player" or target == "target" or target == "focus" then
return BasicUnit:New(target) return BasicUnit:New(target)
elseif target == "group" then elseif target == "group" then
return GroupUnit:New(target) return GroupUnit:New(target)
elseif target == "nameplate" then elseif target == "nameplate" then
return NameplateUnit:New(target) return NameplateUnit:New(target)
end end
end, end,
} }
local unitFactory = UnitFactory:New() local unitFactory = UnitFactory:New()
local Aura = { local Aura = {
New = function(self, entry, index) New = function(self, entry, index)
o = { o = {
["name"] = entry.auraName, ["name"] = entry.auraName,
["unit"] = entry.target, ["unit"] = entry.target,
["hasCooldown"] = entry.hasCooldown, ["hasCooldown"] = entry.hasCooldown,
["index"] = index, ["index"] = index,
["GetAura"] = entry.GetAura, ["GetAura"] = entry.GetAura,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
IsActive = function(self) IsActive = function(self)
for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do
for k2, v2 in pairs(v) do for k2, v2 in pairs(v) do
end end
return true return true
end end
return false return false
end, end,
IsOnCooldown = function(self) IsOnCooldown = function(self)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
return GetSpellCooldown(self.name) > 0 return GetSpellCooldown(self.name) > 0
end, end,
AddAsAura = function(self, allstates) AddAsAura = function(self, allstates)
local auras = self.unit:GetAuras(self.GetAura, self.name) local auras = self.unit:GetAuras(self.GetAura, self.name)
for k,v in pairs(auras) do for k,v in pairs(auras) do
duration = v.duration duration = v.duration
expirationTime = v.expirationTime expirationTime = v.expirationTime
icon = self:GetAuraIcon(v.spellID) icon = self:GetAuraIcon(v.spellID)
allstates[self.name .. k] = { allstates[self.name .. k] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "timed", progressType = "timed",
duration = duration, duration = duration,
expirationTime = expirationTime, expirationTime = expirationTime,
index = self.index, index = self.index,
icon = icon, icon = icon,
pname = k, pname = k,
stacks = v.stacks, stacks = v.stacks,
pclass = v.class, pclass = v.class,
IsOnCooldown = true, IsOnCooldown = true,
IsActive = true, IsActive = true,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end end
end, end,
AddAsCooldown = function(self, allstates) AddAsCooldown = function(self, allstates)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
startTime, duration = GetSpellCooldown(self.name) startTime, duration = GetSpellCooldown(self.name)
icon = self:GetSpellIcon() icon = self:GetSpellIcon()
allstates[self.name] = { allstates[self.name] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "timed", progressType = "timed",
duration = duration, duration = duration,
expirationTime = startTime + duration, expirationTime = startTime + duration,
index = self.index, index = self.index,
icon = icon, icon = icon,
IsOnCooldown = true, IsOnCooldown = true,
IsActive = false, IsActive = false,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end, end,
AddAsIcon = function(self, allstates) AddAsIcon = function(self, allstates)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
icon = self:GetSpellIcon() icon = self:GetSpellIcon()
allstates[self.name] = { allstates[self.name] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "static", progressType = "static",
value = 1, value = 1,
total = 1, total = 1,
index = self.index, index = self.index,
icon = icon, icon = icon,
IsOnCooldown = false, IsOnCooldown = false,
IsActive = false, IsActive = false,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end, end,
GetSpellIcon = function(self) GetSpellIcon = function(self)
return select(3, GetSpellInfo(self.name)) return select(3, GetSpellInfo(self.name))
end, end,
GetAuraIcon = function(self, spellID) GetAuraIcon = function(self, spellID)
return select(3, GetSpellInfo(spellID)) return select(3, GetSpellInfo(spellID))
end, end,
} }
local Entry = { local Entry = {
New = function(self, entry) New = function(self, entry)
entry = self:TrimWhitespace(entry) entry = self:TrimWhitespace(entry)
local entryData = StrSplit(entry, ",") local entryData = StrSplit(entry, ",")
local name = self:ReadEntryData(entryData, 1) local name = self:ReadEntryData(entryData, 1)
local type = self:ReadEntryData(entryData, 2) or "Buff" local type = self:ReadEntryData(entryData, 2) or "Buff"
local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player")
local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false
cooldown = not cooldown cooldown = not cooldown
local GetAura = UnitBuff local GetAura = UnitBuff
if type == "Debuff" then GetAura = UnitDebuff end if type == "Debuff" then GetAura = UnitDebuff end
o = { o = {
["entry"] = entry, ["entry"] = entry,
["auraName"] = name, ["auraName"] = name,
["GetAura"] = GetAura, ["GetAura"] = GetAura,
["target"] = target, ["target"] = target,
["hasCooldown"] = cooldown, ["hasCooldown"] = cooldown,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
ReadEntryData = function(self, entryData, index) ReadEntryData = function(self, entryData, index)
local str = entryData[index] local str = entryData[index]
if str == nil then if str == nil then
return nil return nil
end end
str = self:TrimWhitespace(str) str = self:TrimWhitespace(str)
return str return str
end, end,
TrimWhitespace = function(self, str) TrimWhitespace = function(self, str)
str = str:gsub("^[ ]+", "") str = str:gsub("^[ ]+", "")
str = str:gsub("\n$", "") str = str:gsub("\n$", "")
str = str:gsub("[ ]+$", "") str = str:gsub("[ ]+$", "")
return str return str
end, end,
} }
aura_env.auras = {} aura_env.auras = {}
for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do
entry = Entry:New(entry) entry = Entry:New(entry)
auraObj = Aura:New(entry, #aura_env.auras + 1) auraObj = Aura:New(entry, #aura_env.auras + 1)
aura_env.auras[#aura_env.auras + 1] = auraObj aura_env.auras[#aura_env.auras + 1] = auraObj
end end
aura_env.HandleEvent = function(allstates) aura_env.HandleEvent = function(allstates)
for k, v in ipairs(aura_env.auras) do for k, v in ipairs(aura_env.auras) do
if v:IsActive() then if v:IsActive() then
v:AddAsAura(allstates) v:AddAsAura(allstates)
elseif v:IsOnCooldown() and not v:IsActive() then elseif v:IsOnCooldown() and not v:IsActive() then
v:AddAsCooldown(allstates) v:AddAsCooldown(allstates)
elseif not v:IsOnCooldown() and not v:IsActive() then elseif not v:IsOnCooldown() and not v:IsActive() then
v:AddAsIcon(allstates) v:AddAsIcon(allstates)
end end
end end
end end

View File

@@ -1,317 +1,317 @@
local function StrSplit(inputString, separator) local function StrSplit(inputString, separator)
local outputTable = {} local outputTable = {}
for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do
outputTable[#outputTable + 1] = str outputTable[#outputTable + 1] = str
end end
return outputTable return outputTable
end end
local function PrintTable(table) local function PrintTable(table)
for k,v in pairs(table) do for k,v in pairs(table) do
print(k .. " " .. v) print(k .. " " .. v)
end end
end end
local function GetAuraIndex(func, unit, name) local function GetAuraIndex(func, unit, name)
for i = 1, 40 do for i = 1, 40 do
local aura = func(unit, i) local aura = func(unit, i)
if aura == "name" then return i end if aura == "name" then return i end
if aura == nil then return 0 end if aura == nil then return 0 end
end end
return 0 return 0
end end
aura_env.GetClassColor = function(class) aura_env.GetClassColor = function(class)
if class == "Death Knight" then if class == "Death Knight" then
return "\124cFFC41E3A" return "\124cFFC41E3A"
elseif class == "Druid" then elseif class == "Druid" then
return "\124cFFFF7C0A" return "\124cFFFF7C0A"
elseif class == "Hunter" then elseif class == "Hunter" then
return "\124cFFAAD372" return "\124cFFAAD372"
elseif class == "Mage" then elseif class == "Mage" then
return "\124cFF3FC7EB" return "\124cFF3FC7EB"
elseif class == "Paladin" then elseif class == "Paladin" then
return "\124cFFF48CBA" return "\124cFFF48CBA"
elseif class == "Priest" then elseif class == "Priest" then
return "\124cFFFFFFFF" return "\124cFFFFFFFF"
elseif class == "Rogue" then elseif class == "Rogue" then
return "\124cFFFFF468" return "\124cFFFFF468"
elseif class == "Shaman" then elseif class == "Shaman" then
return "\124cFF0070DD" return "\124cFF0070DD"
elseif class == "Warlock" then elseif class == "Warlock" then
return "\124cFF8788EE" return "\124cFF8788EE"
elseif class == "Warrior" then elseif class == "Warrior" then
return "\124cFFC69B6D" return "\124cFFC69B6D"
end end
end end
local Unit = { local Unit = {
New = function(self, unit) New = function(self, unit)
o = { o = {
["unit"] = unit, ["unit"] = unit,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
GetAuras = function(self, auraFunc, name, type) GetAuras = function(self, auraFunc, name, type)
return nil return nil
end, end,
} }
local BasicUnit = Unit:New("player") local BasicUnit = Unit:New("player")
function BasicUnit:GetAuras(auraFunc, name) function BasicUnit:GetAuras(auraFunc, name)
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name)
if aura ~= nil then if aura ~= nil then
return { return {
[UnitName(self.unit)] = { [UnitName(self.unit)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
} }
else else
return {} return {}
end end
end end
-- Maybe implement some sort of throttle to group unit? -- Maybe implement some sort of throttle to group unit?
local GroupUnit = Unit:New("group") local GroupUnit = Unit:New("group")
function GroupUnit:GetAuras(auraFunc, name) function GroupUnit:GetAuras(auraFunc, name)
local num = GetNumGroupMembers() local num = GetNumGroupMembers()
local unitPrefix = "party" local unitPrefix = "party"
if IsInRaid() then if IsInRaid() then
unitPrefix = "raid" unitPrefix = "raid"
end end
auras = {} auras = {}
for i = 1, num do for i = 1, num do
-- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name)
local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)
if auraIndex > 0 then if auraIndex > 0 then
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex)
auras[UnitName(unitPrefix .. i)] = { auras[UnitName(unitPrefix .. i)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["class"] = UnitClass(unitPrefix .. i) or "Paladin", ["class"] = UnitClass(unitPrefix .. i) or "Paladin",
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
if unitPrefix == "party" then if unitPrefix == "party" then
-- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name)
local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex)
auras[UnitName("player")] = { auras[UnitName("player")] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["class"] = UnitClass(unitPrefix .. i) or "Paladin", ["class"] = UnitClass(unitPrefix .. i) or "Paladin",
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
return auras return auras
end end
-- Nameplate does not work, find out why? -- Nameplate does not work, find out why?
local NameplateUnit = Unit:New("nameplate") local NameplateUnit = Unit:New("nameplate")
function NameplateUnit:GetAuras(auraFunc, name) function NameplateUnit:GetAuras(auraFunc, name)
local unitPrefix = "nameplate" local unitPrefix = "nameplate"
auras = {} auras = {}
for i = 1, 40 do for i = 1, 40 do
-- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name)
local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then
local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex)
auras[UnitName(unitPrefix .. i)] = { auras[UnitName(unitPrefix .. i)] = {
["duration"] = duration, ["duration"] = duration,
["expirationTime"] = expirationTime, ["expirationTime"] = expirationTime,
["spellID"] = spellID, ["spellID"] = spellID,
["stacks"] = stacks or 1, ["stacks"] = stacks or 1,
} }
end end
end end
return auras return auras
end end
local UnitFactory = { local UnitFactory = {
New = function(self) New = function(self)
o = {} o = {}
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
CreateUnit = function(self, target) CreateUnit = function(self, target)
target = string.lower(target) target = string.lower(target)
if target == "player" or target == "target" or target == "focus" then if target == "player" or target == "target" or target == "focus" then
return BasicUnit:New(target) return BasicUnit:New(target)
elseif target == "group" then elseif target == "group" then
return GroupUnit:New(target) return GroupUnit:New(target)
elseif target == "nameplate" then elseif target == "nameplate" then
return NameplateUnit:New(target) return NameplateUnit:New(target)
end end
end, end,
} }
local unitFactory = UnitFactory:New() local unitFactory = UnitFactory:New()
local Aura = { local Aura = {
New = function(self, entry, index) New = function(self, entry, index)
o = { o = {
["name"] = entry.auraName, ["name"] = entry.auraName,
["unit"] = entry.target, ["unit"] = entry.target,
["hasCooldown"] = entry.hasCooldown, ["hasCooldown"] = entry.hasCooldown,
["index"] = index, ["index"] = index,
["GetAura"] = entry.GetAura, ["GetAura"] = entry.GetAura,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
IsActive = function(self) IsActive = function(self)
for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do
return true return true
end end
return false return false
end, end,
IsOnCooldown = function(self) IsOnCooldown = function(self)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
return GetSpellCooldown(self.name) > 0 return GetSpellCooldown(self.name) > 0
end, end,
AddAsAura = function(self, allstates) AddAsAura = function(self, allstates)
local auras = self.unit:GetAuras(self.GetAura, self.name) local auras = self.unit:GetAuras(self.GetAura, self.name)
for k,v in pairs(auras) do for k,v in pairs(auras) do
duration = v.duration duration = v.duration
expirationTime = v.expirationTime expirationTime = v.expirationTime
icon = self:GetAuraIcon(v.spellID) icon = self:GetAuraIcon(v.spellID)
allstates[self.name .. k] = { allstates[self.name .. k] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "timed", progressType = "timed",
duration = duration, duration = duration,
expirationTime = expirationTime, expirationTime = expirationTime,
index = self.index, index = self.index,
icon = icon, icon = icon,
pname = k, pname = k,
stacks = v.stacks, stacks = v.stacks,
pclass = v.class, pclass = v.class,
IsOnCooldown = true, IsOnCooldown = true,
IsActive = true, IsActive = true,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end end
end, end,
AddAsCooldown = function(self, allstates) AddAsCooldown = function(self, allstates)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
startTime, duration = GetSpellCooldown(self.name) startTime, duration = GetSpellCooldown(self.name)
icon = self:GetSpellIcon() icon = self:GetSpellIcon()
allstates[self.name] = { allstates[self.name] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "timed", progressType = "timed",
duration = duration, duration = duration,
expirationTime = startTime + duration, expirationTime = startTime + duration,
index = self.index, index = self.index,
icon = icon, icon = icon,
IsOnCooldown = true, IsOnCooldown = true,
IsActive = false, IsActive = false,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end, end,
AddAsIcon = function(self, allstates) AddAsIcon = function(self, allstates)
if not self.hasCooldown then if not self.hasCooldown then
return false return false
end end
icon = self:GetSpellIcon() icon = self:GetSpellIcon()
allstates[self.name] = { allstates[self.name] = {
changed = true, changed = true,
show = true, show = true,
resort = true, resort = true,
progressType = "static", progressType = "static",
value = 1, value = 1,
total = 1, total = 1,
index = self.index, index = self.index,
icon = icon, icon = icon,
IsOnCooldown = false, IsOnCooldown = false,
IsActive = false, IsActive = false,
IsBad = self.GetAura == UnitDebuff, IsBad = self.GetAura == UnitDebuff,
} }
end, end,
GetSpellIcon = function(self) GetSpellIcon = function(self)
return select(3, GetSpellInfo(self.name)) return select(3, GetSpellInfo(self.name))
end, end,
GetAuraIcon = function(self, spellID) GetAuraIcon = function(self, spellID)
return select(3, GetSpellInfo(spellID)) return select(3, GetSpellInfo(spellID))
end, end,
} }
local Entry = { local Entry = {
New = function(self, entry) New = function(self, entry)
entry = self:TrimWhitespace(entry) entry = self:TrimWhitespace(entry)
local entryData = StrSplit(entry, ",") local entryData = StrSplit(entry, ",")
local name = self:ReadEntryData(entryData, 1) local name = self:ReadEntryData(entryData, 1)
local type = self:ReadEntryData(entryData, 2) or "Buff" local type = self:ReadEntryData(entryData, 2) or "Buff"
local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player")
local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false
cooldown = not cooldown cooldown = not cooldown
local GetAura = UnitBuff local GetAura = UnitBuff
if type == "Debuff" then GetAura = UnitDebuff end if type == "Debuff" then GetAura = UnitDebuff end
o = { o = {
["entry"] = entry, ["entry"] = entry,
["auraName"] = name, ["auraName"] = name,
["GetAura"] = GetAura, ["GetAura"] = GetAura,
["target"] = target, ["target"] = target,
["hasCooldown"] = cooldown, ["hasCooldown"] = cooldown,
} }
setmetatable(o, self) setmetatable(o, self)
self.__index = self self.__index = self
return o return o
end, end,
ReadEntryData = function(self, entryData, index) ReadEntryData = function(self, entryData, index)
local str = entryData[index] local str = entryData[index]
if str == nil then if str == nil then
return nil return nil
end end
str = self:TrimWhitespace(str) str = self:TrimWhitespace(str)
return str return str
end, end,
TrimWhitespace = function(self, str) TrimWhitespace = function(self, str)
str = str:gsub("^[ ]+", "") str = str:gsub("^[ ]+", "")
str = str:gsub("\n$", "") str = str:gsub("\n$", "")
str = str:gsub("[ ]+$", "") str = str:gsub("[ ]+$", "")
return str return str
end, end,
} }
aura_env.auras = {} aura_env.auras = {}
for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do
entry = Entry:New(entry) entry = Entry:New(entry)
auraObj = Aura:New(entry, #aura_env.auras + 1) auraObj = Aura:New(entry, #aura_env.auras + 1)
aura_env.auras[#aura_env.auras + 1] = auraObj aura_env.auras[#aura_env.auras + 1] = auraObj
end end
aura_env.HandleEvent = function(allstates) aura_env.HandleEvent = function(allstates)
for k, v in ipairs(aura_env.auras) do for k, v in ipairs(aura_env.auras) do
if v:IsActive() then if v:IsActive() then
v:AddAsAura(allstates) v:AddAsAura(allstates)
elseif v:IsOnCooldown() and not v:IsActive() then elseif v:IsOnCooldown() and not v:IsActive() then
v:AddAsCooldown(allstates) v:AddAsCooldown(allstates)
elseif not v:IsOnCooldown() and not v:IsActive() then elseif not v:IsOnCooldown() and not v:IsActive() then
v:AddAsIcon(allstates) v:AddAsIcon(allstates)
end end
end end
end end

View File

@@ -1,11 +1,11 @@
## While aura is active show aura ## While aura is active show aura
## While aura is inactive and off cooldown show icon ## While aura is inactive and off cooldown show icon
## While aura is inactive and on cooldown show cooldown ## While aura is inactive and on cooldown show cooldown
## Use tsu ## Use tsu
### ACTIONBAR_UPDATE_COOLDOWN when anything on bar goes on cooldown ### ACTIONBAR_UPDATE_COOLDOWN when anything on bar goes on cooldown
### UNIT_AURA with one argument which is unit when aura fades/gets applied ### UNIT_AURA with one argument which is unit when aura fades/gets applied

View File

@@ -1,12 +1,12 @@
function(allstates, e, ...) function(allstates, e, ...)
for _,v in pairs(allstates) do for _,v in pairs(allstates) do
v.show = false v.show = false
v.changed = true v.changed = true
end end
aura_env.HandleEvent(allstates) aura_env.HandleEvent(allstates)
return true return true
end end
-- /run WeakAuras.ScanEvents("SPELL_UPDATE_COOLDOWN") -- /run WeakAuras.ScanEvents("SPELL_UPDATE_COOLDOWN")
-- /dump UnitAura("player", "Blessing of Might") -- /dump UnitAura("player", "Blessing of Might")

View File

@@ -1,102 +1,102 @@
function() function()
--- @class Item --- @class Item
--- @field id number --- @field id number
--- @field name string --- @field name string
--- @field ilvl number --- @field ilvl number
--- @field type string --- @field type string
--- @field new function --- @field new function
Item = { Item = {
--- @param self Item --- @param self Item
--- @return Item --- @return Item
new = function(self) new = function(self)
local obj = {} local obj = {}
obj.id = id or -1 obj.id = id or -1
obj.name = name or "" obj.name = name or ""
obj.ilvl = ilvl or -1 obj.ilvl = ilvl or -1
obj.type = type or "" obj.type = type or ""
setmetatable(obj, self) setmetatable(obj, self)
self.__index = self self.__index = self
return obj return obj
end, end,
} }
--- @class ItemSet --- @class ItemSet
--- @field items Item[] --- @field items Item[]
--- @field new function --- @field new function
--- @field equip function --- @field equip function
ItemSet = { ItemSet = {
--- @param self ItemSet --- @param self ItemSet
--- @return ItemSet --- @return ItemSet
new = function(self, items) new = function(self, items)
local obj = {} local obj = {}
obj.items = items or {} obj.items = items or {}
setmetatable(obj, self) setmetatable(obj, self)
self.__index = self self.__index = self
return obj return obj
end, end,
equip = function(self) equip = function(self)
local equippedItems = getEquippedItems() local equippedItems = getEquippedItems()
print(#equippedItems .. " items equipped") print(#equippedItems .. " items equipped")
for itemSlot, eqItem in pairs(equippedItems) do for itemSlot, eqItem in pairs(equippedItems) do
local item = self.items[itemSlot] local item = self.items[itemSlot]
if (eqItem.id ~= item.id and eqItem.ilvl ~= item.ilvl) then if (eqItem.id ~= item.id and eqItem.ilvl ~= item.ilvl) then
print("Unequip " .. itemSlot) print("Unequip " .. itemSlot)
PickupInventoryItem(itemSlot) PickupInventoryItem(itemSlot)
PutItemInBag(22) PutItemInBag(22)
print("Equip " .. item.id) print("Equip " .. item.id)
EquipItemByName(item.id, itemSlot) EquipItemByName(item.id, itemSlot)
end end
end end
end end
} }
--- @return string --- @return string
function getItemName(itemLink) function getItemName(itemLink)
return select(1, GetItemInfo(itemLink)) return select(1, GetItemInfo(itemLink))
end end
--- @return number --- @return number
function getItemIlvl(itemLink) function getItemIlvl(itemLink)
return select(4, GetItemInfo(itemLink)) return select(4, GetItemInfo(itemLink))
end end
--- @return string --- @return string
function getItemType(itemLink) function getItemType(itemLink)
return select(9, GetItemInfo(itemLink)) return select(9, GetItemInfo(itemLink))
end end
--- @return Item[] --- @return Item[]
function getEquippedItems() function getEquippedItems()
--- @type Item[] --- @type Item[]
local items = {} local items = {}
for i = 1, 19 do for i = 1, 19 do
--- @type Item --- @type Item
local item = Item:new() local item = Item:new()
--- @type string --- @type string
local eqItemLink = GetInventoryItemLink("player", i) local eqItemLink = GetInventoryItemLink("player", i)
--- @type number --- @type number
local eqItemId = GetInventoryItemID("player", i) local eqItemId = GetInventoryItemID("player", i)
if (eqItemLink ~= nil) then if (eqItemLink ~= nil) then
item.name = getItemName(eqItemLink) item.name = getItemName(eqItemLink)
item.ilvl = getItemIlvl(eqItemLink) item.ilvl = getItemIlvl(eqItemLink)
item.type = getItemType(eqItemLink) item.type = getItemType(eqItemLink)
item.id = eqItemId item.id = eqItemId
items[i] = item items[i] = item
end end
end end
return items return items
end end
--- @type ItemSet --- @type ItemSet
local set = ItemSet:new(getEquippedItems()) local set = ItemSet:new(getEquippedItems())
set:equip() set:equip()
end end

View File

@@ -1,10 +1,10 @@
function() function()
if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then
local target = select(5, CombatLogGetCurrentEventInfo()) local target = select(5, CombatLogGetCurrentEventInfo())
local buff = select(13, CombatLogGetCurrentEventInfo()) local buff = select(13, CombatLogGetCurrentEventInfo())
if target == UnitName("player") and aura_env.buffs[buff] ~= nil then if target == UnitName("player") and aura_env.buffs[buff] ~= nil then
aura_env.max = aura_env.GetAbsorbs() aura_env.max = aura_env.GetAbsorbs()
end end
end end
return aura_env.GetAbsorbs() > 0 return aura_env.GetAbsorbs() > 0
end end

View File

@@ -1,10 +1,10 @@
function() function()
if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then
local target = select(5, CombatLogGetCurrentEventInfo()) local target = select(5, CombatLogGetCurrentEventInfo())
local buff = select(13, CombatLogGetCurrentEventInfo()) local buff = select(13, CombatLogGetCurrentEventInfo())
if target == UnitName("player") and aura_env.buffs[buff] ~= nil then if target == UnitName("player") and aura_env.buffs[buff] ~= nil then
aura_env.timeApplied = GetTime() aura_env.timeApplied = GetTime()
return true return true
end end
end end
end end

View File

@@ -1,3 +1,3 @@
function() function()
return aura_env.GetAbsorbs(), aura_env.max, 1 return aura_env.GetAbsorbs(), aura_env.max, 1
end end

View File

@@ -1,3 +1,3 @@
function() function()
return 15, aura_env.timeApplied + 15 return 15, aura_env.timeApplied + 15
end end

View File

@@ -1,37 +1,37 @@
aura_env.buffs = { aura_env.buffs = {
["Null Barrier"] = 1, ["Null Barrier"] = 1,
["Empowered Null Barrier"] = 1, ["Empowered Null Barrier"] = 1,
} }
aura_env.max = 0 aura_env.max = 0
aura_env.GetBuff = function(name) aura_env.GetBuff = function(name)
for i = 1, 40 do for i = 1, 40 do
if UnitBuff("player", i) == name then if UnitBuff("player", i) == name then
return i return i
end end
end end
return 0 return 0
end end
aura_env.GetAbsorb = function(name) aura_env.GetAbsorb = function(name)
local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) local temp = select(16, UnitBuff("player", aura_env.GetBuff(name)))
if temp then return temp else return 0 end if temp then return temp else return 0 end
end end
aura_env.GetAbsorbs = function() aura_env.GetAbsorbs = function()
local abs = 0 local abs = 0
for k, v in pairs(aura_env.buffs) do for k, v in pairs(aura_env.buffs) do
abs = abs + aura_env.GetAbsorb(k) abs = abs + aura_env.GetAbsorb(k)
end end
return abs return abs
end end
aura_env.PrettyPrintNum = function(n) aura_env.PrettyPrintNum = function(n)
if n > 1e6 then if n > 1e6 then
return string.format("%.2fM", n / 1e6) return string.format("%.2fM", n / 1e6)
elseif n > 1e3 then elseif n > 1e3 then
return string.format("%.2fk", n / 1e3) return string.format("%.2fk", n / 1e3)
else else
return n return n
end end
end end

View File

@@ -1,4 +1,4 @@
aura_env.buffs = { aura_env.buffs = {
["Null Barrier"] = 1, ["Null Barrier"] = 1,
} }
aura_env.timeApplied = 0 aura_env.timeApplied = 0

View File

@@ -1,3 +1,3 @@
function() function()
return aura_env.PrettyPrintNum(aura_env.GetAbsorbs()) return aura_env.PrettyPrintNum(aura_env.GetAbsorbs())
end end

View File

@@ -1,41 +1,41 @@
aura_env.buffs = { aura_env.buffs = {
["Null Barrier"] = 1, ["Null Barrier"] = 1,
["Empowered Null Barrier"] = 1, ["Empowered Null Barrier"] = 1,
["Resounding Protection"] = 1, ["Resounding Protection"] = 1,
["Guard"] = 1, ["Guard"] = 1,
["Void Shroud"] = 1, ["Void Shroud"] = 1,
["Stoneskin"] = 1, ["Stoneskin"] = 1,
} }
aura_env.max = 0 aura_env.max = 0
aura_env.GetBuff = function(name) aura_env.GetBuff = function(name)
for i = 1, 40 do for i = 1, 40 do
if UnitBuff("player", i) == name then if UnitBuff("player", i) == name then
return i return i
end end
end end
return 0 return 0
end end
aura_env.GetAbsorb = function(name) aura_env.GetAbsorb = function(name)
local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) local temp = select(16, UnitBuff("player", aura_env.GetBuff(name)))
if temp then return temp else return 0 end if temp then return temp else return 0 end
end end
aura_env.GetAbsorbs = function() aura_env.GetAbsorbs = function()
local abs = 0 local abs = 0
for k, v in pairs(aura_env.buffs) do for k, v in pairs(aura_env.buffs) do
abs = abs + aura_env.GetAbsorb(k) abs = abs + aura_env.GetAbsorb(k)
end end
return abs return abs
end end
aura_env.PrettyPrintNum = function(n) aura_env.PrettyPrintNum = function(n)
if n > 1e6 then if n > 1e6 then
return string.format("%.2fM", n / 1e6) return string.format("%.2fM", n / 1e6)
elseif n > 1e3 then elseif n > 1e3 then
return string.format("%.2fk", n / 1e3) return string.format("%.2fk", n / 1e3)
else else
return n return n
end end
end end

View File

@@ -1,7 +1,7 @@
function(e, ...) function(e, ...)
aura_env.currentStat = aura_env.GetPrimaryStat() aura_env.currentStat = aura_env.GetPrimaryStat()
if aura_env.maxStat < aura_env.currentStat then if aura_env.maxStat < aura_env.currentStat then
aura_env.maxStat = aura_env.currentStat aura_env.maxStat = aura_env.currentStat
end end
return true return true
end end

View File

@@ -1,3 +1,3 @@
function() function()
return aura_env.currentStat, aura_env.maxStat, 1 return aura_env.currentStat, aura_env.maxStat, 1
end end

View File

@@ -1,17 +1,17 @@
aura_env.specStatTable = { aura_env.specStatTable = {
["Windwalker"] = 2, ["Windwalker"] = 2,
["Brewmaster"] = 2, ["Brewmaster"] = 2,
["Mistweaver"] = 4, ["Mistweaver"] = 4,
} }
aura_env.maxStat = 0 aura_env.maxStat = 0
aura_env.currentStat = 0 aura_env.currentStat = 0
aura_env.GetPrimaryStat = function() aura_env.GetPrimaryStat = function()
stat = UnitStat("player", aura_env.GetPrimStatID()) stat = UnitStat("player", aura_env.GetPrimStatID())
return stat return stat
end end
aura_env.GetPrimStatID = function() aura_env.GetPrimStatID = function()
specID, specName = GetSpecializationInfo(GetSpecialization()) specID, specName = GetSpecializationInfo(GetSpecialization())
return aura_env.specStatTable[specName] return aura_env.specStatTable[specName]
end end