From 349eac65360c26f126c9cabdbd1c570ee1e5e589 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 15:47:08 +0100 Subject: [PATCH 01/27] Initial commit --- NewAge/NullBarrier/CLEU.lua | 3 +++ NewAge/NullBarrier/INIT.lua | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 NewAge/NullBarrier/CLEU.lua create mode 100644 NewAge/NullBarrier/INIT.lua diff --git a/NewAge/NullBarrier/CLEU.lua b/NewAge/NullBarrier/CLEU.lua new file mode 100644 index 0000000..e493906 --- /dev/null +++ b/NewAge/NullBarrier/CLEU.lua @@ -0,0 +1,3 @@ +function() + +end \ No newline at end of file diff --git a/NewAge/NullBarrier/INIT.lua b/NewAge/NullBarrier/INIT.lua new file mode 100644 index 0000000..a3bcf60 --- /dev/null +++ b/NewAge/NullBarrier/INIT.lua @@ -0,0 +1,7 @@ +aura_env.GetBuff = function(name) + for i = 1, 40 do + if UnitBuff("player", i) == name then + return i + end + end +end \ No newline at end of file From d66d6d6687c31a817847c2990da6e932d5888b6e Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 16:27:51 +0100 Subject: [PATCH 02/27] Absorb amount is now properly displayed --- NewAge/NullBarrier/CLEU.lua | 9 ++++++++- NewAge/NullBarrier/CustomDuration | 0 NewAge/NullBarrier/INIT.lua | 27 +++++++++++++++++++++++++++ NewAge/NullBarrier/Text.lua | 3 +++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 NewAge/NullBarrier/CustomDuration create mode 100644 NewAge/NullBarrier/Text.lua diff --git a/NewAge/NullBarrier/CLEU.lua b/NewAge/NullBarrier/CLEU.lua index e493906..4c6d995 100644 --- a/NewAge/NullBarrier/CLEU.lua +++ b/NewAge/NullBarrier/CLEU.lua @@ -1,3 +1,10 @@ function() - + if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then + local target = select(5, CombatLogGetCurrentEventInfo()) + local buff = select(13, CombatLogGetCurrentEventInfo()) + if target == UnitName("player") and aura_env.buffs[buff] ~= nil then + aura_env.max = select(16, CombatLogGetCurrentEventInfo()) + end + end + return true end \ No newline at end of file diff --git a/NewAge/NullBarrier/CustomDuration b/NewAge/NullBarrier/CustomDuration new file mode 100644 index 0000000..e69de29 diff --git a/NewAge/NullBarrier/INIT.lua b/NewAge/NullBarrier/INIT.lua index a3bcf60..c3aeabc 100644 --- a/NewAge/NullBarrier/INIT.lua +++ b/NewAge/NullBarrier/INIT.lua @@ -1,7 +1,34 @@ +aura_env.buffs = {"Null Barrier", "Empowered Null Barrier"} +aura_env.max = 0 + aura_env.GetBuff = function(name) for i = 1, 40 do if UnitBuff("player", i) == name then return i end end + return 0 +end + +aura_env.GetAbsorb = function(name) + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then return temp else return 0 end +end + +aura_env.GetAbsorbs = function() + local abs = 0 + for k, v in ipairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(v) + end + return abs +end + +aura_env.PrettyPrintNum = function(n) + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end end \ No newline at end of file diff --git a/NewAge/NullBarrier/Text.lua b/NewAge/NullBarrier/Text.lua new file mode 100644 index 0000000..7459d14 --- /dev/null +++ b/NewAge/NullBarrier/Text.lua @@ -0,0 +1,3 @@ +function() + return aura_env.PrettyPrintNum(aura_env.GetAbsorbs()) +end \ No newline at end of file From 180cd36eb25edbafddd7ed02399700c2fc4f630d Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 16:33:03 +0100 Subject: [PATCH 03/27] Bar now fully functional --- NewAge/NullBarrier/CLEU.lua | 2 +- NewAge/NullBarrier/CustomDuration | 0 NewAge/NullBarrier/CustomDuration.lua | 3 +++ NewAge/NullBarrier/INIT.lua | 9 ++++++--- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 NewAge/NullBarrier/CustomDuration create mode 100644 NewAge/NullBarrier/CustomDuration.lua diff --git a/NewAge/NullBarrier/CLEU.lua b/NewAge/NullBarrier/CLEU.lua index 4c6d995..1f3cf06 100644 --- a/NewAge/NullBarrier/CLEU.lua +++ b/NewAge/NullBarrier/CLEU.lua @@ -3,7 +3,7 @@ function() local target = select(5, CombatLogGetCurrentEventInfo()) local buff = select(13, CombatLogGetCurrentEventInfo()) if target == UnitName("player") and aura_env.buffs[buff] ~= nil then - aura_env.max = select(16, CombatLogGetCurrentEventInfo()) + aura_env.max = aura_env.GetAbsorbs() end end return true diff --git a/NewAge/NullBarrier/CustomDuration b/NewAge/NullBarrier/CustomDuration deleted file mode 100644 index e69de29..0000000 diff --git a/NewAge/NullBarrier/CustomDuration.lua b/NewAge/NullBarrier/CustomDuration.lua new file mode 100644 index 0000000..8732875 --- /dev/null +++ b/NewAge/NullBarrier/CustomDuration.lua @@ -0,0 +1,3 @@ +function() + return aura_env.GetAbsorbs(), aura_env.max, 1 +end \ No newline at end of file diff --git a/NewAge/NullBarrier/INIT.lua b/NewAge/NullBarrier/INIT.lua index c3aeabc..0390795 100644 --- a/NewAge/NullBarrier/INIT.lua +++ b/NewAge/NullBarrier/INIT.lua @@ -1,4 +1,7 @@ -aura_env.buffs = {"Null Barrier", "Empowered Null Barrier"} +aura_env.buffs = { + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, +} aura_env.max = 0 aura_env.GetBuff = function(name) @@ -17,8 +20,8 @@ end aura_env.GetAbsorbs = function() local abs = 0 - for k, v in ipairs(aura_env.buffs) do - abs = abs + aura_env.GetAbsorb(v) + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) end return abs end From e4e33c8e1a861f848b48f0d8ad2d47154745be00 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 16:48:55 +0100 Subject: [PATCH 04/27] Decided to make 2 auras in a group, one for absorb and the other for cooldown --- NewAge/NullBarrier/{CLEU.lua => CLEU1.lua} | 2 +- NewAge/NullBarrier/{CustomDuration.lua => CustomDuration1.lua} | 0 NewAge/NullBarrier/{INIT.lua => INIT1.lua} | 0 NewAge/NullBarrier/{Text.lua => Text1.lua} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename NewAge/NullBarrier/{CLEU.lua => CLEU1.lua} (90%) rename NewAge/NullBarrier/{CustomDuration.lua => CustomDuration1.lua} (100%) rename NewAge/NullBarrier/{INIT.lua => INIT1.lua} (100%) rename NewAge/NullBarrier/{Text.lua => Text1.lua} (100%) diff --git a/NewAge/NullBarrier/CLEU.lua b/NewAge/NullBarrier/CLEU1.lua similarity index 90% rename from NewAge/NullBarrier/CLEU.lua rename to NewAge/NullBarrier/CLEU1.lua index 1f3cf06..68ec099 100644 --- a/NewAge/NullBarrier/CLEU.lua +++ b/NewAge/NullBarrier/CLEU1.lua @@ -6,5 +6,5 @@ function() aura_env.max = aura_env.GetAbsorbs() end end - return true + return aura_env.GetAbsorbs() > 0 end \ No newline at end of file diff --git a/NewAge/NullBarrier/CustomDuration.lua b/NewAge/NullBarrier/CustomDuration1.lua similarity index 100% rename from NewAge/NullBarrier/CustomDuration.lua rename to NewAge/NullBarrier/CustomDuration1.lua diff --git a/NewAge/NullBarrier/INIT.lua b/NewAge/NullBarrier/INIT1.lua similarity index 100% rename from NewAge/NullBarrier/INIT.lua rename to NewAge/NullBarrier/INIT1.lua diff --git a/NewAge/NullBarrier/Text.lua b/NewAge/NullBarrier/Text1.lua similarity index 100% rename from NewAge/NullBarrier/Text.lua rename to NewAge/NullBarrier/Text1.lua From 3af5a433907a8eb18e19a6c020575a5b6af13166 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 17:03:56 +0100 Subject: [PATCH 05/27] Added second bar to tell cooldown --- NewAge/NullBarrier/CLEU2.lua | 10 ++++++++++ NewAge/NullBarrier/CustomDuration2.lua | 3 +++ NewAge/NullBarrier/INIT2.lua | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 NewAge/NullBarrier/CLEU2.lua create mode 100644 NewAge/NullBarrier/CustomDuration2.lua create mode 100644 NewAge/NullBarrier/INIT2.lua diff --git a/NewAge/NullBarrier/CLEU2.lua b/NewAge/NullBarrier/CLEU2.lua new file mode 100644 index 0000000..ea53242 --- /dev/null +++ b/NewAge/NullBarrier/CLEU2.lua @@ -0,0 +1,10 @@ +function() + if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then + local target = select(5, CombatLogGetCurrentEventInfo()) + local buff = select(13, CombatLogGetCurrentEventInfo()) + if target == UnitName("player") and aura_env.buffs[buff] ~= nil then + aura_env.timeApplied = GetTime() + return true + end + end +end \ No newline at end of file diff --git a/NewAge/NullBarrier/CustomDuration2.lua b/NewAge/NullBarrier/CustomDuration2.lua new file mode 100644 index 0000000..5d2f12c --- /dev/null +++ b/NewAge/NullBarrier/CustomDuration2.lua @@ -0,0 +1,3 @@ +function() + return 15, aura_env.timeApplied + 15 +end \ No newline at end of file diff --git a/NewAge/NullBarrier/INIT2.lua b/NewAge/NullBarrier/INIT2.lua new file mode 100644 index 0000000..3c074e2 --- /dev/null +++ b/NewAge/NullBarrier/INIT2.lua @@ -0,0 +1,4 @@ +aura_env.buffs = { + ["Null Barrier"] = 1, +} +aura_env.timeApplied = 0 \ No newline at end of file From 806c44d51ab1a19d5972ef4b22a683c2f65f2e45 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 17:06:35 +0100 Subject: [PATCH 06/27] Added export --- NewAge/Export | 1 + 1 file changed, 1 insertion(+) create mode 100644 NewAge/Export diff --git a/NewAge/Export b/NewAge/Export new file mode 100644 index 0000000..bab5c4b --- /dev/null +++ b/NewAge/Export @@ -0,0 +1 @@ +!WA:2!TJ1wZTT1ryZWXJhJz6ul6y7Ax3eyLABPAzfDXwojTkoK0usuvMugKY3DibioKawGaihaOBPjtJsBQ6T0w10oTD6THV0x60h4VGm6xWoA6pGo6H(dWp0xD39aqkqA5Xj95YzejWb7zp75B)oF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2kfYD7CkrJic)P50UlGZALZALLYlxa3Dz2WXPzIq6x5WN6ouEQP76Q1ypmRkMRTBG9f9WLYF59V7YLOja3Vk8vO31a72EN4nqPi8NHIQLRHAsyu41vwLiuxza4sTVLfBTnMj7SxBSBHf2O3yHzKH2lgTDWjBh22xR5kQK)(fluo9cWvLEc9cx0RazR3LzNyRXGmNaYMaUbKRVwkHzsaZcZb)vHHXl(vg)Jk(PaLq1crvpslck4ETdU224xnwHms0lTRRLj2X4LWhjkPDArjTp()xs7)9sAXX1PLXWOmoqSYzXYh(8a2bwMJsfunRBH5uSlJBAeQ2Fsy(uurQ)nM(VdCp4(WTtiQt0jZ)UjGkvHQvH7wfEi8i4bvb1ovkanOgONey9vdGe3rn(y1a6BKbEMrQpFsungAyagrc8G5wNc(y8rlp45DblHAn0e(uWgCa3pcEVeahPYEGpABaSsymSkSM75EgTk3keewb1wRzsVOCsy9ZEi4XjHnG3h(EWhaFy7qLrHuXbi252rSBj47xf(OZbBMW9vFEltuBIgWpOFjr4hgjfcFc8JGTmG)aEM)pza)4QWpb1ZGFA0BXL6cq(QW8UZ(L6L2I9cz9YygJETW9FRv4NdFkQjTxCFipb87mGF10W2WVgvHuxVy9zTgV0A3Nb)g432vkd(fWVeU8rGFVq2IKQ)zH4(FSk8zjG)m8xq5is(fLB7kafBLF(ArikC8cu3sPikgX0qwkrZ6WljsjrijIjYfd5LO4cYxjfRQcEjXWF(8YV89MeYlt0HxEgbVmkVgMrV2bMxJqLjKILAjubrEclrOkcQrGKWxe77uQO30YKIYHhwquie)sTvCV23n7S5RD)I3JqDkHeb7X(paa5nqL8)wOcFYuR8pV7)9d \ No newline at end of file From e07e998fc723f9ce603b19b2afb5f88d4748d2a3 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 12 Nov 2021 17:07:57 +0100 Subject: [PATCH 07/27] Updated export --- NewAge/Export | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewAge/Export b/NewAge/Export index bab5c4b..3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, 27 Nov 2021 20:42:27 +0100 Subject: [PATCH 08/27] Moved export --- NewAge/{ => NullBarrier}/Export | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename NewAge/{ => NullBarrier}/Export (100%) diff --git a/NewAge/Export b/NewAge/NullBarrier/Export similarity index 100% rename from NewAge/Export rename to NewAge/NullBarrier/Export From 3b9c1133f6eddb2e716c40da78e84986fc7331c4 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Sat, 27 Nov 2021 21:03:04 +0100 Subject: [PATCH 09/27] Added PrimaryStatBar --- NewAge/PrimaryStatBar/CLEU.lua | 7 +++++++ NewAge/PrimaryStatBar/CustomDuration.lua | 3 +++ NewAge/PrimaryStatBar/Export.txt | 1 + NewAge/PrimaryStatBar/INIT.lua | 17 +++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 NewAge/PrimaryStatBar/CLEU.lua create mode 100644 NewAge/PrimaryStatBar/CustomDuration.lua create mode 100644 NewAge/PrimaryStatBar/Export.txt create mode 100644 NewAge/PrimaryStatBar/INIT.lua diff --git a/NewAge/PrimaryStatBar/CLEU.lua b/NewAge/PrimaryStatBar/CLEU.lua new file mode 100644 index 0000000..d3a2230 --- /dev/null +++ b/NewAge/PrimaryStatBar/CLEU.lua @@ -0,0 +1,7 @@ +function(e, ...) + aura_env.currentStat = aura_env.GetPrimaryStat() + if aura_env.maxStat < aura_env.currentStat then + aura_env.maxStat = aura_env.currentStat + end + return true +end \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/CustomDuration.lua b/NewAge/PrimaryStatBar/CustomDuration.lua new file mode 100644 index 0000000..0f7d858 --- /dev/null +++ b/NewAge/PrimaryStatBar/CustomDuration.lua @@ -0,0 +1,3 @@ +function() + return aura_env.currentStat, aura_env.maxStat, 1 +end \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/Export.txt b/NewAge/PrimaryStatBar/Export.txt new file mode 100644 index 0000000..98aff93 --- /dev/null +++ b/NewAge/PrimaryStatBar/Export.txt @@ -0,0 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w78S)68MvUbXCgKHK9vLJx4gFjSg2QEHTohfUOWDZIB8rfF8I9((x()( \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/INIT.lua b/NewAge/PrimaryStatBar/INIT.lua new file mode 100644 index 0000000..3a66dbc --- /dev/null +++ b/NewAge/PrimaryStatBar/INIT.lua @@ -0,0 +1,17 @@ +aura_env.specStatTable = { + ["Windwalker"] = 2, + ["Brewmaster"] = 2, + ["Mistweaver"] = 4, +} +aura_env.maxStat = 0 +aura_env.currentStat = 0 + +aura_env.GetPrimaryStat = function() + stat = UnitStat("player", aura_env.GetPrimStatID()) + return stat +end + +aura_env.GetPrimStatID = function() + specID, specName = GetSpecializationInfo(GetSpecialization()) + return aura_env.specStatTable[specName] +end \ No newline at end of file From f899e14ff8de861d1b35a86a04ffec96087299c8 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Tue, 30 Nov 2021 17:25:24 +0100 Subject: [PATCH 10/27] Add OverallAbsorbs which is pretty much a copy of NullBarrier --- NewAge/OverallAbsorbs/Export.txt | 1 + NewAge/OverallAbsorbs/INIT.lua | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 NewAge/OverallAbsorbs/Export.txt create mode 100644 NewAge/OverallAbsorbs/INIT.lua diff --git a/NewAge/OverallAbsorbs/Export.txt b/NewAge/OverallAbsorbs/Export.txt new file mode 100644 index 0000000..7628805 --- /dev/null +++ b/NewAge/OverallAbsorbs/Export.txt @@ -0,0 +1 @@ +!WA:2!nA1YUnsrxyScsaEZKjadGe)sTS0mYbYK7jWSiaUD6KyWJTvB7jZv5uT7YURjTRQvvv7epi(LiRyDepbEnR8JqEcAfXtq2ZMSG1CQQ70(cbgAP0P8PQZ58DUuFNoZEl0Bb3fC)Lvhkcq8JpK4k9(4l0RR2PJalFAMlrHspgVAGKWOISdBhkKSEnWNkdoOtiTTsC(fZAapCSmKtnqHCulmT)Y1abYb14eQSsyV8PY3hll4iyChr(fxmlM6YhK4T3D7TwERriABWJ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ocOcN7SPjbGB2)O(g7lYvj033WeScbimEfSXAlLSJvVa2jyo214F(m2yblK6sODnaulXAKm9r2peXDNw0tyexJ6ECw4mBuxcxjfhtsnXpLDgcPvZMDs6fZyMZuIE1SIy(jOsAq0gXyZvnCztszQikvAMsuUKbrZ4Ru)VZjMqRrEB8EA(TPXxm93TJWKHh4EbtW9V9s3g6MnKJTYIPJ10grH7BGIwa2xGtXMgS)d4tmjaNeCi9wRMMqpEjJ(geQraIWf5NUNAXjtYXkQE)L3Y4G8hV4To3WrmdcN(ZOMknMg7uyYYA4TNUSLyrbmsH2D54B15ZD)LxVZJH0j1yfLkjGaYsPMzJ)RM54uZSXyZmRE00Oe(78jyKpxp9sad(STlT)bnmFdJ1lJPIH(OrAgKd08p7Wv0tHC8ql)(nlzubqW6He3rFvO4r)G9(pV5gBfpsPr85cYxsnhSdQn(LfraTnTlCV9Lnl9WX)6H11FbPwnVHsw7(XJm)0mp63sCoX1ftTRy9el74ppUykZ(OokslymksI(a7tutn28U2i)ap0Coqu1H0nlKTu2e7LJ4EvvyjY3pPtBedirOXF86WdQAx65vR0Oq5HQXUK4VZMFAcd91oO2h3LRiygpDBbHZ6lV2xV8Ml0)3F6Fb \ No newline at end of file diff --git a/NewAge/OverallAbsorbs/INIT.lua b/NewAge/OverallAbsorbs/INIT.lua new file mode 100644 index 0000000..2fe5496 --- /dev/null +++ b/NewAge/OverallAbsorbs/INIT.lua @@ -0,0 +1,41 @@ +aura_env.buffs = { + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, + ["Resounding Protection"] = 1, + ["Guard"] = 1, + ["Void Shroud"] = 1, + ["Stoneskin"] = 1, +} +aura_env.max = 0 + +aura_env.GetBuff = function(name) + for i = 1, 40 do + if UnitBuff("player", i) == name then + return i + end + end + return 0 +end + +aura_env.GetAbsorb = function(name) + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then return temp else return 0 end +end + +aura_env.GetAbsorbs = function() + local abs = 0 + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) + end + return abs +end + +aura_env.PrettyPrintNum = function(n) + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end +end \ No newline at end of file From 34256fb7d2597befd900af5fbd686445fe67b153 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Sun, 5 Dec 2021 15:23:20 +0100 Subject: [PATCH 11/27] add little AH refresh bot to alert about low and high prices --- .../AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua | 19 +++++++++++++++++++ NewAge/AHBot/EveryFrameThrottled.lua | 6 ++++++ NewAge/AHBot/INIT.lua | 13 +++++++++++++ NewAge/AHBot/Info.txt | 3 +++ 4 files changed, 41 insertions(+) create mode 100644 NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua create mode 100644 NewAge/AHBot/EveryFrameThrottled.lua create mode 100644 NewAge/AHBot/INIT.lua create mode 100644 NewAge/AHBot/Info.txt diff --git a/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua new file mode 100644 index 0000000..edbc415 --- /dev/null +++ b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua @@ -0,0 +1,19 @@ +function() + results = C_AuctionHouse.GetBrowseResults() + -- DevTools_Dump(results) + for k,v in ipairs(results) do + local itemID = v.itemKey.itemID + local itemName = GetItemInfo(itemID) + if aura_env.sellPriceThresholds[itemID] then + if v.minPrice > aura_env.sellPriceThresholds[itemID] then + print(itemName, "too expensive") + return true + end + elseif aura_env.buyPriceThresholds[itemID] then + if v.minPrice < aura_env.buyPriceThresholds[itemID] then + print(itemName, "too cheap") + return true + end + end + end +end \ No newline at end of file diff --git a/NewAge/AHBot/EveryFrameThrottled.lua b/NewAge/AHBot/EveryFrameThrottled.lua new file mode 100644 index 0000000..6e30da2 --- /dev/null +++ b/NewAge/AHBot/EveryFrameThrottled.lua @@ -0,0 +1,6 @@ +function() + if not aura_env.last or aura_env.last < GetTime() - aura_env.throttleTime then + aura_env.last = GetTime() + AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() + end +end \ No newline at end of file diff --git a/NewAge/AHBot/INIT.lua b/NewAge/AHBot/INIT.lua new file mode 100644 index 0000000..e45fba0 --- /dev/null +++ b/NewAge/AHBot/INIT.lua @@ -0,0 +1,13 @@ +aura_env.throttleTime = 10 + +aura_env.sellPriceThresholds = { + [168446] = 5000 * 100 * 100; -- Accord of Critical Strike + [168447] = 5000 * 100 * 100; -- Accord of Haste + [168448] = 5000 * 100 * 100; -- Accord of Mastery + [168449] = 5000 * 100 * 100; -- Accord of Versatility +} + +aura_env.buyPriceThresholds = { + [152576] = 5 * 100 * 100; -- Tidesrpay Linen + [152877] = 500 * 100 * 100; -- Veiled Crystal +} \ No newline at end of file diff --git a/NewAge/AHBot/Info.txt b/NewAge/AHBot/Info.txt new file mode 100644 index 0000000..599f3f8 --- /dev/null +++ b/NewAge/AHBot/Info.txt @@ -0,0 +1,3 @@ +/run AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() + +/dump C_AuctionHouse.GetBrowseResults() \ No newline at end of file From 5f35c4e4e21698feb17201281015304aa49cfd91 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Fri, 31 Dec 2021 12:01:02 +0100 Subject: [PATCH 12/27] Add dynamic aura tracker --- NewAge/CataAuraBar/INIT.lua | 98 ++++++++++++++++++++++++++++++++++++ NewAge/CataAuraBar/README.md | 11 ++++ NewAge/CataAuraBar/TSU.lua | 12 +++++ 3 files changed, 121 insertions(+) create mode 100644 NewAge/CataAuraBar/INIT.lua create mode 100644 NewAge/CataAuraBar/README.md create mode 100644 NewAge/CataAuraBar/TSU.lua diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua new file mode 100644 index 0000000..de31613 --- /dev/null +++ b/NewAge/CataAuraBar/INIT.lua @@ -0,0 +1,98 @@ +local Aura = { + New = function(self, spellName, index) + o = { + ["name"] = spellName, + ["index"] = index or 1, + } + setmetatable(o, self) + self.__index = self + return o + end, + IsActive = function(self) + aura = self:GetAuraName() + print(UnitAura("player", aura)) + return UnitAura("player", aura) ~= nil + end, + IsOnCooldown = function(self) + return GetSpellCooldown(self.name) > 0 + end, + GetAuraName = function(self) + aura = self.aura + if aura == nil then + aura = self.name + end + return aura + end, + AddAsAura = function(self, allstates) + aura = self:GetAuraName() + duration = select(6, UnitAura("player", aura)) + expirationTime = select(7, UnitAura("player", aura)) + icon = self:GetAuraIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + } + end, + AddAsCooldown = function(self, allstates) + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + } + end, + AddAsIcon = function(self, allstates) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + } + end, + GetSpellIcon = function(self) + return select(3, GetSpellInfo(self.name)) + end, + GetAuraIcon = function(self) + aura = self:GetAuraName() + spellID = select(11, UnitAura("player", aura)) + return select(3, GetSpellInfo(spellID)) + end, +} + +aura_env.auras = {} +for name in string.gmatch(aura_env.config.spellList, "([a-zA-Z ]+)") do + name = name:gsub("^[ ]+", "") + name = name:gsub("\n$", "") + name = name:gsub("[ ]+$", "") + auraObj = Aura:New(name, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj +end + +aura_env.HandleEvent = function(allstates) + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end +end \ No newline at end of file diff --git a/NewAge/CataAuraBar/README.md b/NewAge/CataAuraBar/README.md new file mode 100644 index 0000000..528ead0 --- /dev/null +++ b/NewAge/CataAuraBar/README.md @@ -0,0 +1,11 @@ +## While aura is active show aura + +## While aura is inactive and off cooldown show icon + +## While aura is inactive and on cooldown show cooldown + +## Use tsu + +### ACTIONBAR_UPDATE_COOLDOWN when anything on bar goes on cooldown + +### UNIT_AURA with one argument which is unit when aura fades/gets applied \ No newline at end of file diff --git a/NewAge/CataAuraBar/TSU.lua b/NewAge/CataAuraBar/TSU.lua new file mode 100644 index 0000000..a2fc638 --- /dev/null +++ b/NewAge/CataAuraBar/TSU.lua @@ -0,0 +1,12 @@ +function(allstates, e, ...) + for _,v in pairs(allstates) do + v.show = false + v.changed = true + end + + aura_env.HandleEvent(allstates) + return true +end + +-- /run WeakAuras.ScanEvents("SPELL_UPDATE_COOLDOWN") +-- /dump UnitAura("player", "Blessing of Might") \ No newline at end of file From 06b11f955c1fba0861a78df94c99aab8b344a344 Mon Sep 17 00:00:00 2001 From: PhatDave Date: Sat, 1 Jan 2022 04:04:50 +0100 Subject: [PATCH 13/27] Extend castaurabar functionality to include buffs and debuffs from various sources --- .../AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua | 4 +- NewAge/AHBot/INIT.lua | 4 + NewAge/Automation/INIT.lua | 380 ++++++++++++++++++ ...HOW MERCHANT_CLOSED EQUIP_BIND_CONFIRM.lua | 205 ++++++++++ NewAge/Automation/LOOT_READY.lua | 69 ++++ NewAge/CataAuraBar/CustomOptions.lua | 20 + NewAge/CataAuraBar/INIT.lua | 116 ++++-- NewAge/CataAuraBar/TSU.lua | 2 +- 8 files changed, 774 insertions(+), 26 deletions(-) create mode 100644 NewAge/Automation/INIT.lua create mode 100644 NewAge/Automation/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.lua create mode 100644 NewAge/Automation/LOOT_READY.lua create mode 100644 NewAge/CataAuraBar/CustomOptions.lua diff --git a/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua index edbc415..c3898d1 100644 --- a/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua +++ b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua @@ -7,12 +7,12 @@ function() if aura_env.sellPriceThresholds[itemID] then if v.minPrice > aura_env.sellPriceThresholds[itemID] then print(itemName, "too expensive") - return true + SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) end elseif aura_env.buyPriceThresholds[itemID] then if v.minPrice < aura_env.buyPriceThresholds[itemID] then print(itemName, "too cheap") - return true + SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) end end end diff --git a/NewAge/AHBot/INIT.lua b/NewAge/AHBot/INIT.lua index e45fba0..bcb3b97 100644 --- a/NewAge/AHBot/INIT.lua +++ b/NewAge/AHBot/INIT.lua @@ -5,6 +5,10 @@ aura_env.sellPriceThresholds = { [168447] = 5000 * 100 * 100; -- Accord of Haste [168448] = 5000 * 100 * 100; -- Accord of Mastery [168449] = 5000 * 100 * 100; -- Accord of Versatility + [168592] = 4500 * 100 * 100; -- Oceanic Restoration + [168496] = 4500 * 100 * 100; -- Force Multiplier + [168593] = 4500 * 100 * 100; -- Machinist's Brilliance + [168598] = 4500 * 100 * 100; -- Naga Hide } aura_env.buyPriceThresholds = { diff --git a/NewAge/Automation/INIT.lua b/NewAge/Automation/INIT.lua new file mode 100644 index 0000000..5d2439d --- /dev/null +++ b/NewAge/Automation/INIT.lua @@ -0,0 +1,380 @@ +aura_env.debug = true +aura_env.filter = { + [1] = true, --Gold + [2] = true, --Azerite + [3] = true, --War resources + [4] = true, --Residuum + [5] = true, --Manapearls + [6] = true, --Mounts + [7] = true, --High ilvl + [8] = false, --Herbs + [9] = true, --Cooking + [10] = true, --Cloth + [11] = false, --Metal & Stone + [12] = true, --Gold filter greys + [13] = true, -- >1 && <4 quality items, no gear + [14] = true, --Quest items + [15] = true, --All greys + [16] = true, --Whitelist + [17] = true, --Quest items (different filter) + [18] = true, --Class aproperiate >2 items + [19] = true, --Jewelery >2 quality + [20] = true, --Additional mount filter + [21] = true, --Tradeskill // Elemental +} +aura_env.ilvlFilter = 200 +aura_env.goldFilter = 0.5 +aura_env.goldFilter = aura_env.goldFilter * 10000 +aura_env.throttleSell = false + +aura_env.whitelist = { + ["Pygmy Suckerfish"] = 1, + ["Drakkari Offerings"] = 1, + ["Deepcoral Pod"] = 1, + ["Hardened Spring"] = 1, + ["Machined Gear Assembly"] = 1, + ["Tempered Plating"] = 1, + ["Hefty Glimmershell"] = 1, + ["Fresh Meat"] = 1, + ["Wood"] = 1, + + + ["Gloom Dust"] = 1, + ["Veiled Crytal"] = 1, + ["Coalescing Visions"] = 1, + ["Echoes of Ny'alotha"] = 1, + ["Corrupted Mementos"] = 1, + + ["Blood of Sargeras"] = 1, + ["Primal Sargerite"] = 1, + + ["Chain Ignitercoil"] = 1, + ["Galvanic Oscillator"] = 1, + ["Corrupted Memento"] = 1, +} +aura_env.sellWhitelist = { + ["Blacksmith Hammer"] = 1, + ["Endless Tincture of Renewed Combat"] = 1, + ["Mr. Munchykins"] = 1, + ["Arclight Spanner"] = 1, + ["Runeblade of Baron Rivendare"] = 1, +} +aura_env.toSell = {} +aura_env.getequipID = function(equip) + if equip == "INVTYPE_HEAD" then return 1 + elseif equip == "INVTYPE_NECK" then return 2 + elseif equip == "INVTYPE_SHOULDER" then return 3 + elseif equip == "INVTYPE_BODY" then return 4 + elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5 + elseif equip == "INVTYPE_WAIST" then return 6 + elseif equip == "INVTYPE_LEGS" then return 7 + elseif equip == "INVTYPE_FEET" then return 8 + elseif equip == "INVTYPE_WRIST" then return 9 + elseif equip == "INVTYPE_HAND" then return 10 + 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_SHIELD" then return 17 + else return nil end +end +aura_env.skills = { + --Warrior + [1] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 1, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Paladin + [2] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Hunter + [3] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Rogue + [4] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Priest + [5] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Death Knight + [6] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Shaman + [7] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Mage + [8] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Warlock + [9] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Monk + [10] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Druid + [11] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Demon Hunter + [12] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 1, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, +} \ No newline at end of file diff --git a/NewAge/Automation/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.lua b/NewAge/Automation/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.lua new file mode 100644 index 0000000..25f096e --- /dev/null +++ b/NewAge/Automation/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.lua @@ -0,0 +1,205 @@ + +function(e) + local aura_env = aura_env + if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot + local slot = 1 + local lootinfo = GetLootInfo() + for k, v in pairs(lootinfo) do + if v.locked == false then + local link = GetLootSlotLink(slot) + local looted = false + 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 + LootSlot(slot) + elseif aura_env.filter[2] == true and link:match("Azerite") then + LootSlot(slot) + elseif aura_env.filter[3] == true and v.item:match("War Resources") then + LootSlot(slot) + elseif aura_env.filter[4] == true and v.item:match("Residuum") then + LootSlot(slot) + elseif aura_env.filter[5] == true and v.item:match("Manapearl") then + LootSlot(slot) + end + if link then + local icon = v.texture + local id = link:match("item:(%d+):") + local type = select(6, GetItemInfo(link)) or "" + local subtype = select(7, GetItemInfo(link)) or "" + local ilvl = select(4, GetItemInfo(link)) or 0 + local equip = select(9, GetItemInfo(link)) + if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then + LootSlot(slot) + elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then + LootSlot(slot) + elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then + LootSlot(slot) + elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then + LootSlot(slot) + elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then + LootSlot(slot) + elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then + LootSlot(slot) + elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then + LootSlot(slot) + elseif aura_env.filter[14] == true and v.isQuestItem == true then + LootSlot(slot) + elseif aura_env.filter[15] == true and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then + LootSlot(slot) + elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then + LootSlot(slot) + elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then + LootSlot(slot) + else + 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 + 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 + LootSlot(slot) + end + elseif aura_env.filter[20] == true and type == "Miscellaneous" then + if subtype == "Mount" then + LootSlot(slot) + end + end + end + end + slot = slot + 1 + end + end + --CloseLoot() + elseif e == "EQUIP_BIND_CONFIRM" then + StaticPopup1Button1:Click() + elseif e == "SCRAPPING_MACHINE_SHOW" then + for i = 0, 4 do + for j = 1, GetContainerNumSlots(i) do + local link = select(7, GetContainerItemInfo(i, j)) + if link then + local name = GetItemInfo(link) + local rarity = select(3, GetItemInfo(link)) + local ilvl = select(4, GetItemInfo(link)) or 0 + local type = select(6, GetItemInfo(link)) + local equip = select(9, GetItemInfo(link)) or "" + local price = select(11, GetItemInfo(link)) + if aura_env.sellWhitelist[name] ~= 1 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 + UseContainerItem(i, j) + elseif rarity > 3 and aura_env.getequipID(equip) then + if equip ~= "INVTYPE_FINGER" then + local eqID = aura_env.getequipID(equip) + local elink = GetInventoryItemLink("player", eqID) + local eilvl = select(4, GetItemInfo(elink)) or 0 + if eilvl > ilvl + 5 then + print("Scrapping " .. link .. "over " .. eilvl - ilvl .. " ilvl difference from " .. elink) + UseContainerItem(i, j) + end + elseif equip == "INVTYPE_FINGER" then + local eqID1, eqID2 = 11, 12 + local elink1, elink2 = GetInventoryItemLink("player", eqID1), GetInventoryItemLink("player", eqID2) + local eilvl1, eilvl2 = select(4, GetItemInfo(elink1)) or 0, select(4, GetItemInfo(elink2)) or 0 + if eilvl1 > ilvl + 5 then + print("Scrapping " .. link .. " over " .. eilvl1 - ilvl .. " ilvl difference from " .. elink1) + UseContainerItem(i, j) + elseif eilvl2 > ilvl + 5 then + print("Scrapping " .. link .. " over " .. eilvl2 - ilvl .. " ilvl difference from " .. elink2) + UseContainerItem(i, j) + end + end + end + end + end + end + end + end + elseif e == "MERCHANT_SHOW" then --Sell grey and white wepaon + if CanMerchantRepair() == true then RepairAllItems() end + local i, j = 0, 1 + for c = 0, 4 do + for s = 1, GetContainerNumSlots(c) do + local link = select(7, GetContainerItemInfo(c, s)) + if link then + local name = GetItemInfo(link) + local rarity = select(3, GetItemInfo(link)) + local ilvl = select(4, GetItemInfo(link)) or 0 + local type = select(6, GetItemInfo(link)) + local price = select(11, GetItemInfo(link)) + if price and price > 0 then + if aura_env.sellWhitelist[name] ~= 1 then + if rarity == 0 then + if aura_env.throttleSell == true then + aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} + else + UseContainerItem(c, s) + end + elseif (type == "Armor" or type == "Weapon") and ilvl < 200 then + if aura_env.throttleSell == true then + aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} + else + UseContainerItem(c, s) + end + end + end + end + end + end + end + if aura_env.throttleSell == true then + aura_env.ticker = C_Timer.NewTicker(0.05, function() + if aura_env.toSell[1] then + UseContainerItem(aura_env.toSell[1].c, aura_env.toSell[1].s) + table.remove(aura_env.toSell, 1) + else + aura_env.ticker:Cancel() + end + if j >= GetContainerNumSlots(i) then i = i + 1 + j = 1 end + if i >= 4 then aura_env.ticker:Cancel() end + end) + end + elseif e == "MERCHANT_CLOSED" then + if aura_env.ticker then aura_env.ticker:Cancel() end + aura_env.toSell = {} + elseif e == "QUEST_POI_UPDATE" then + CloseGossip() + elseif e == "QUEST_DETAIL" then + AcceptQuest() + elseif e == "QUEST_COMPLETE" then + if GetNumQuestChoices() <= 1 then + GetQuestReward(1) + end + elseif e == "GOSSIP_SHOW" then + local quests = GetNumGossipAvailableQuests() + local complquests = GetNumGossipActiveQuests() + local opt = GetNumGossipOptions() + if complquests > 0 and opt == 0 then + for i = 1, complquests do + SelectGossipActiveQuest(i) + end + end + if quests > 0 and opt == 0 then + SelectGossipAvailableQuest(1) + end + if opt == 1 and quests + complquests == 0 then + SelectGossipOption(1) + end + elseif e == "QUEST_GREETING" then + local quests = GetNumGossipAvailableQuests() + local complquests = GetNumGossipActiveQuests() + if complquests > 0 then + for i = 1, complquests do + SelectActiveQuest(1) + end + end + if quests > 0 then + SelectAvailableQuest(1) + end + elseif e == "QUEST_PROGRESS" then + if IsQuestCompletable(i) then + CompleteQuest() + end + end +end \ No newline at end of file diff --git a/NewAge/Automation/LOOT_READY.lua b/NewAge/Automation/LOOT_READY.lua new file mode 100644 index 0000000..dc26120 --- /dev/null +++ b/NewAge/Automation/LOOT_READY.lua @@ -0,0 +1,69 @@ +-- LOOT_READY LOOT_OPENED + +function(e, ...) + local slot = 1 + local lootinfo = GetLootInfo() + for k, v in pairs(lootinfo) do + if v.locked == false then + local link = GetLootSlotLink(slot) + 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 + LootSlot(slot) + elseif aura_env.filter[2] == true and link:match("Azerite") then + LootSlot(slot) + elseif aura_env.filter[3] == true and v.item:match("War Resources") then + LootSlot(slot) + elseif aura_env.filter[4] == true and v.item:match("Residuum") then + LootSlot(slot) + elseif aura_env.filter[5] == true and v.item:match("Manapearl") then + LootSlot(slot) + end + if link then + local type = select(6, GetItemInfo(link)) or "" + local subtype = select(7, GetItemInfo(link)) or "" + local ilvl = select(4, GetItemInfo(link)) or 0 + local equip = select(9, GetItemInfo(link)) + if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then + LootSlot(slot) + elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then + LootSlot(slot) + elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then + LootSlot(slot) + elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then + LootSlot(slot) + elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then + LootSlot(slot) + elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then + LootSlot(slot) + elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then + LootSlot(slot) + elseif aura_env.filter[14] == true and v.isQuestItem == true then + LootSlot(slot) + elseif aura_env.filter[15] == true and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then + LootSlot(slot) + elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then + LootSlot(slot) + elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then + LootSlot(slot) + else + 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 + 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 + LootSlot(slot) + end + elseif aura_env.filter[20] == true and type == "Miscellaneous" then + if subtype == "Mount" then + LootSlot(slot) + end + end + end + end + slot = slot + 1 + end + end +end \ No newline at end of file diff --git a/NewAge/CataAuraBar/CustomOptions.lua b/NewAge/CataAuraBar/CustomOptions.lua new file mode 100644 index 0000000..462869e --- /dev/null +++ b/NewAge/CataAuraBar/CustomOptions.lua @@ -0,0 +1,20 @@ +{ + IsOnCooldown = { + type = "bool", + test = function(state, needle) + return state.IsOnCooldown == (needle == 1) + end, + }, + IsActive = { + type = "bool", + test = function(state, needle) + return state.IsActive == (needle == 1) + end, + }, + IsDebuff = { + type = "bool", + test = function(state, needle) + return state.IsBad == (needle == 1) + end, + }, +} \ No newline at end of file diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index de31613..71c35dd 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -1,32 +1,45 @@ +local function StrSplit(inputString, separator) + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable +end + +local function PrintTable(table) + for k,v in pairs(table) do + print(k .. " " .. v) + end +end + local Aura = { - New = function(self, spellName, index) + New = function(self, entry, index) o = { - ["name"] = spellName, - ["index"] = index or 1, + ["name"] = entry.auraName, + ["type"] = entry.auraType, + ["target"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, } setmetatable(o, self) self.__index = self return o end, + IsActive = function(self) - aura = self:GetAuraName() - print(UnitAura("player", aura)) - return UnitAura("player", aura) ~= nil + return self.GetAura(self.target, self.name, self.type) ~= nil end, IsOnCooldown = function(self) + if not self.hasCooldown then + return false + end return GetSpellCooldown(self.name) > 0 end, - GetAuraName = function(self) - aura = self.aura - if aura == nil then - aura = self.name - end - return aura - end, + AddAsAura = function(self, allstates) - aura = self:GetAuraName() - duration = select(6, UnitAura("player", aura)) - expirationTime = select(7, UnitAura("player", aura)) + duration = select(6, self.GetAura(self.target, self.name, self.type)) + expirationTime = select(7, self.GetAura(self.target, self.name, self.type)) icon = self:GetAuraIcon() allstates[self.name] = { changed = true, @@ -37,9 +50,15 @@ local Aura = { expirationTime = expirationTime, index = self.index, icon = icon, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, } end, AddAsCooldown = function(self, allstates) + if not self.hasCooldown then + return false + end startTime, duration = GetSpellCooldown(self.name) icon = self:GetSpellIcon() allstates[self.name] = { @@ -51,9 +70,15 @@ local Aura = { expirationTime = startTime + duration, index = self.index, icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, } end, AddAsIcon = function(self, allstates) + if not self.hasCooldown then + return false + end icon = self:GetSpellIcon() allstates[self.name] = { changed = true, @@ -64,24 +89,69 @@ local Aura = { total = 1, index = self.index, icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, } end, + GetSpellIcon = function(self) return select(3, GetSpellInfo(self.name)) end, GetAuraIcon = function(self) - aura = self:GetAuraName() - spellID = select(11, UnitAura("player", aura)) + spellID = select(11, self.GetAura(self.target, self.name, self.type)) return select(3, GetSpellInfo(spellID)) end, } +local Entry = { + New = function(self, entry) + entry = self:TrimWhitespace(entry) + + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = self:ReadEntryData(entryData, 3) or "Player" + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff + + if type == "Debuff" then GetAura = UnitDebuff end + + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, + + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then + return nil + end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, +} + aura_env.auras = {} -for name in string.gmatch(aura_env.config.spellList, "([a-zA-Z ]+)") do - name = name:gsub("^[ ]+", "") - name = name:gsub("\n$", "") - name = name:gsub("[ ]+$", "") - auraObj = Aura:New(name, #aura_env.auras + 1) +for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do + entry = Entry:New(entry) + + auraObj = Aura:New(entry, #aura_env.auras + 1) aura_env.auras[#aura_env.auras + 1] = auraObj end diff --git a/NewAge/CataAuraBar/TSU.lua b/NewAge/CataAuraBar/TSU.lua index a2fc638..704ff7c 100644 --- a/NewAge/CataAuraBar/TSU.lua +++ b/NewAge/CataAuraBar/TSU.lua @@ -3,7 +3,7 @@ function(allstates, e, ...) v.show = false v.changed = true end - + aura_env.HandleEvent(allstates) return true end From 808d3ba96b2498090e0675364060510bb815994f Mon Sep 17 00:00:00 2001 From: PhatDave Date: Tue, 4 Jan 2022 19:04:39 +0100 Subject: [PATCH 14/27] Implement group and nameplate search --- NewAge/CataAuraBar/CustomText.lua | 11 ++ NewAge/CataAuraBar/INIT.lua | 173 ++++++++++++++++++++++++++---- 2 files changed, 162 insertions(+), 22 deletions(-) create mode 100644 NewAge/CataAuraBar/CustomText.lua diff --git a/NewAge/CataAuraBar/CustomText.lua b/NewAge/CataAuraBar/CustomText.lua new file mode 100644 index 0000000..5fc5c1a --- /dev/null +++ b/NewAge/CataAuraBar/CustomText.lua @@ -0,0 +1,11 @@ +function() + if aura_env.state.pname then + output = "" + if aura_env.state.pclass then + output = aura_env.GetClassColor(aura_env.state.pclass) .. aura_env.state.pname .. "\124r" + else + output = aura_env.state.pname + end + return output + end +end \ No newline at end of file diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index 71c35dd..3466432 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -12,12 +12,133 @@ local function PrintTable(table) end end +aura_env.GetClassColor = function(class) + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end +end + +local Unit = { + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, + + GetAuras = function(self, auraFunc, name, type) + return nil + end, +} +local BasicUnit = Unit:New("player") +function BasicUnit:GetAuras(auraFunc, name) + local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + } + } +end +-- Maybe implement some sort of throttle to group unit? +local GroupUnit = Unit:New("group") +function GroupUnit:GetAuras(auraFunc, name) + local raidMem = GetNumRaidMembers() + local num = GetNumPartyMembers() + local unitPrefix = "party" + if raidMem > num then + unitPrefix = "raid" + num = raidMem + end + auras = {} + for i = 1, num do + local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + } + end + end + if unitPrefix == "party" then + local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + if aura ~= nil then + auras[UnitName("player")] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + } + end + end + return auras +end +local NameplateUnit = Unit:New("nameplate") +function NameplateUnit:GetAuras(auraFunc, name) + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + } + end + end + return auras +end + +local UnitFactory = { + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, + + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, +} +local unitFactory = UnitFactory:New() + local Aura = { New = function(self, entry, index) o = { ["name"] = entry.auraName, - ["type"] = entry.auraType, - ["target"] = entry.target, + ["unit"] = entry.target, ["hasCooldown"] = entry.hasCooldown, ["index"] = index, ["GetAura"] = entry.GetAura, @@ -28,7 +149,10 @@ local Aura = { end, IsActive = function(self) - return self.GetAura(self.target, self.name, self.type) ~= nil + for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + return true + end + return false end, IsOnCooldown = function(self) if not self.hasCooldown then @@ -38,22 +162,28 @@ local Aura = { end, AddAsAura = function(self, allstates) - duration = select(6, self.GetAura(self.target, self.name, self.type)) - expirationTime = select(7, self.GetAura(self.target, self.name, self.type)) - icon = self:GetAuraIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = expirationTime, - index = self.index, - icon = icon, - IsOnCooldown = true, - IsActive = true, - IsBad = self.GetAura == UnitDebuff, - } + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k,v in pairs(auras) do + print(k, v) + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end end, AddAsCooldown = function(self, allstates) if not self.hasCooldown then @@ -98,8 +228,7 @@ local Aura = { GetSpellIcon = function(self) return select(3, GetSpellInfo(self.name)) end, - GetAuraIcon = function(self) - spellID = select(11, self.GetAura(self.target, self.name, self.type)) + GetAuraIcon = function(self, spellID) return select(3, GetSpellInfo(spellID)) end, } @@ -111,7 +240,7 @@ local Entry = { local entryData = StrSplit(entry, ",") local name = self:ReadEntryData(entryData, 1) local type = self:ReadEntryData(entryData, 2) or "Buff" - local target = 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 cooldown = not cooldown local GetAura = UnitBuff From de8eaf1318ec7065237ca3ab28769f76c427fb4e Mon Sep 17 00:00:00 2001 From: PhatDave Date: Tue, 4 Jan 2022 19:07:19 +0100 Subject: [PATCH 15/27] Remove prints --- NewAge/CataAuraBar/INIT.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index 3466432..2008859 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -96,6 +96,7 @@ function GroupUnit:GetAuras(auraFunc, name) end return auras end +-- Nameplate does not work, find out why? local NameplateUnit = Unit:New("nameplate") function NameplateUnit:GetAuras(auraFunc, name) local unitPrefix = "nameplate" @@ -164,7 +165,6 @@ local Aura = { AddAsAura = function(self, allstates) local auras = self.unit:GetAuras(self.GetAura, self.name) for k,v in pairs(auras) do - print(k, v) duration = v.duration expirationTime = v.expirationTime icon = self:GetAuraIcon(v.spellID) From b172e1c18aef3a7cbcc535e47b83bb1ebdd6b09a Mon Sep 17 00:00:00 2001 From: PhatDave Date: Thu, 6 Jan 2022 19:24:42 +0100 Subject: [PATCH 16/27] Add stack display --- NewAge/CataAuraBar/INIT.lua | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index 2008859..391db19 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -52,14 +52,19 @@ local Unit = { } local BasicUnit = Unit:New("player") function BasicUnit:GetAuras(auraFunc, name) - local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) - return { - [UnitName(self.unit)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } } - } + else + return {} + end end -- Maybe implement some sort of throttle to group unit? local GroupUnit = Unit:New("group") @@ -73,24 +78,26 @@ function GroupUnit:GetAuras(auraFunc, name) end auras = {} for i = 1, num do - local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) if aura ~= nil then auras[UnitName(unitPrefix .. i)] = { ["duration"] = duration, ["expirationTime"] = expirationTime, ["spellID"] = spellID, ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, } end end if unitPrefix == "party" then - local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) if aura ~= nil then auras[UnitName("player")] = { ["duration"] = duration, ["expirationTime"] = expirationTime, ["spellID"] = spellID, ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, } end end @@ -102,12 +109,13 @@ function NameplateUnit:GetAuras(auraFunc, name) local unitPrefix = "nameplate" auras = {} for i = 1, 40 do - local aura, _, _, _, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) if aura ~= nil then auras[UnitName(unitPrefix .. i)] = { ["duration"] = duration, ["expirationTime"] = expirationTime, ["spellID"] = spellID, + ["stacks"] = stacks or 1, } end end @@ -151,6 +159,8 @@ local Aura = { IsActive = function(self) for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + for k2, v2 in pairs(v) do + end return true end return false @@ -178,6 +188,7 @@ local Aura = { index = self.index, icon = icon, pname = k, + stacks = v.stacks, pclass = v.class, IsOnCooldown = true, IsActive = true, From a6b4d8230ad1fc068a6822dd6459d487ee065deb Mon Sep 17 00:00:00 2001 From: PhatDave Date: Thu, 6 Jan 2022 19:24:54 +0100 Subject: [PATCH 17/27] Add export --- NewAge/CataAuraBar/Export | 1 + 1 file changed, 1 insertion(+) create mode 100644 NewAge/CataAuraBar/Export diff --git a/NewAge/CataAuraBar/Export b/NewAge/CataAuraBar/Export new file mode 100644 index 0000000..f200633 --- /dev/null +++ b/NewAge/CataAuraBar/Export @@ -0,0 +1 @@ +!WA:2!TVttxUXXXje8uKjKtS0AjMiAfNrq0maMGG7h0KumpgfaSaCx79lpalPOPjXoyMgaJ2bZmUNzWUGkRt0AfhLVUSx8PKd7HCWVCAZTCZ8yo1p(YpahDi)a4VGuv3Z3yWU7Zw0pNxcEKaZ0DvvxDvvxF0DV5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7You9r8Rxi)kcwYh0uz1WBDzi9waRWd(0pn)IvkMoji)aBC6ltu0AgGEPqcvj(LprGL)fE50XArXM0GhQDX04huxySczUtuHLLoDcVK)U)eCyfjPTAKf6zqNBuMxM28f50lPVHyub9We8AQXk0iMBdJZ0OBzwqLTCrf)GqrlCrPGPq0)kfXR6)0QbJZ7rv5KUmOGAY4qyMrXzXRtAQkKeG4xNncX5R2n1Pkz7LyPwjuLZyXJq3MQIwH6cpe)7gb1J4a944AloeZyVPsDCAtN2cDgluHEM27r0P87p3sIug(HItf)bZLENboE9kv8jps6XxfVtHfNnm)qZlFgqGejnmzXVhe7cbeBVgXIIeoSM6MsecU4cexn8IJWV3ekx7P1U2pOY8x7dKsCDjc8(Xv58T2iUppKMB27JH(rd5OURi9(P4URg4blz7pkd4ES)Mzceo1nFi2LfnUYjvwjIcdL4vgQhvAy0GKOgrWIB8DccAwQ802CJVtyLTLYi)h)9CcPruOzGoaRYDBDUiEiEZEacO1V6dcpxQSgGyBdkEtK)AxH9ZhYEYZdUKpTA9EflZ(EVo7N9lyBCr2)8(52UP5apJ(49MDDLb6Qv8VVuveNBzfP5lu3akeZcV6Zt1vlQ1tb)V1nSS0YctWwhP8S6Fn8ASWHqoZ(VhvzSU7ePgupNHz0)6excyH0gkdmRUxwHUR0wGioluvmiJTW)sgW4667I3A6PaQbX0XJsI6X3jo0vBcE)M6d(z8CHXw0TyZwHUzBEYT(b9DAnWvr)hThi8X)Cbi7iRyypujpB7lDf2GBYEZ8ho2)AeFyWnHvMN9zEQiZxhaW)TVB(v(W)Rf4Fw5d)LZZ)K)qivwBc1Dc7HS7xG1MDH5g)F(r)pp \ No newline at end of file From 91b04ec9c353f4d5819aeb7f5e2c713fe2954e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Majdand=C5=BEi=C4=87?= Date: Sun, 3 Mar 2024 13:49:36 +0100 Subject: [PATCH 18/27] Add EquipmentManager module --- ...OSED EQUIP_BIND_CONFIRM.lua => Eventz.lua} | 2 +- NewAge/CataAuraBar/INIT_BFA.lua | 317 ++++++++++++++++++ NewAge/EquipmentManager/INIT.lua | 102 ++++++ 3 files changed, 420 insertions(+), 1 deletion(-) rename NewAge/Automation/{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.lua => Eventz.lua} (98%) create mode 100644 NewAge/CataAuraBar/INIT_BFA.lua create mode 100644 NewAge/EquipmentManager/INIT.lua diff --git a/NewAge/Automation/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.lua b/NewAge/Automation/Eventz.lua similarity index 98% rename from NewAge/Automation/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.lua rename to NewAge/Automation/Eventz.lua index 25f096e..007e5a0 100644 --- a/NewAge/Automation/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.lua +++ b/NewAge/Automation/Eventz.lua @@ -1,4 +1,4 @@ - +--- 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) local aura_env = aura_env if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot diff --git a/NewAge/CataAuraBar/INIT_BFA.lua b/NewAge/CataAuraBar/INIT_BFA.lua new file mode 100644 index 0000000..3da4350 --- /dev/null +++ b/NewAge/CataAuraBar/INIT_BFA.lua @@ -0,0 +1,317 @@ +local function StrSplit(inputString, separator) + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable +end + +local function PrintTable(table) + for k,v in pairs(table) do + print(k .. " " .. v) + end +end + +local function GetAuraIndex(func, unit, name) + for i = 1, 40 do + local aura = func(unit, i) + if aura == "name" then return i end + if aura == nil then return 0 end + end + return 0 +end + +aura_env.GetClassColor = function(class) + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end +end + +local Unit = { + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, + + GetAuras = function(self, auraFunc, name, type) + return nil + end, +} +local BasicUnit = Unit:New("player") +function BasicUnit:GetAuras(auraFunc, name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + } + else + return {} + end +end +-- Maybe implement some sort of throttle to group unit? +local GroupUnit = Unit:New("group") +function GroupUnit:GetAuras(auraFunc, name) + local num = GetNumGroupMembers() + local unitPrefix = "party" + if IsInRaid() then + unitPrefix = "raid" + end + auras = {} + for i = 1, num do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) + if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + if unitPrefix == "party" then + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName("player")] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + return auras +end +-- Nameplate does not work, find out why? +local NameplateUnit = Unit:New("nameplate") +function NameplateUnit:GetAuras(auraFunc, name) + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + end + end + return auras +end + +local UnitFactory = { + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, + + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, +} +local unitFactory = UnitFactory:New() + +local Aura = { + New = function(self, entry, index) + o = { + ["name"] = entry.auraName, + ["unit"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, + } + setmetatable(o, self) + self.__index = self + return o + end, + + IsActive = function(self) + for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + return true + end + return false + end, + IsOnCooldown = function(self) + if not self.hasCooldown then + return false + end + return GetSpellCooldown(self.name) > 0 + end, + + AddAsAura = function(self, allstates) + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k,v in pairs(auras) do + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + stacks = v.stacks, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end + end, + AddAsCooldown = function(self, allstates) + if not self.hasCooldown then + return false + end + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + AddAsIcon = function(self, allstates) + if not self.hasCooldown then + return false + end + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + + GetSpellIcon = function(self) + return select(3, GetSpellInfo(self.name)) + end, + GetAuraIcon = function(self, spellID) + return select(3, GetSpellInfo(spellID)) + end, +} + +local Entry = { + New = function(self, entry) + entry = self:TrimWhitespace(entry) + + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff + + if type == "Debuff" then GetAura = UnitDebuff end + + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, + + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then + return nil + end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, +} + +aura_env.auras = {} +for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do + entry = Entry:New(entry) + + auraObj = Aura:New(entry, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj +end + +aura_env.HandleEvent = function(allstates) + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end +end \ No newline at end of file diff --git a/NewAge/EquipmentManager/INIT.lua b/NewAge/EquipmentManager/INIT.lua new file mode 100644 index 0000000..5d3f7f8 --- /dev/null +++ b/NewAge/EquipmentManager/INIT.lua @@ -0,0 +1,102 @@ +function() + --- @class Item + --- @field id number + --- @field name string + --- @field ilvl number + --- @field type string + + --- @field new function + Item = { + --- @param self Item + --- @return Item + new = function(self) + local obj = {} + obj.id = id or -1 + obj.name = name or "" + obj.ilvl = ilvl or -1 + obj.type = type or "" + setmetatable(obj, self) + self.__index = self + return obj + end, + } + + --- @class ItemSet + --- @field items Item[] + + --- @field new function + --- @field equip function + ItemSet = { + --- @param self ItemSet + --- @return ItemSet + new = function(self, items) + local obj = {} + obj.items = items or {} + setmetatable(obj, self) + self.__index = self + return obj + end, + + equip = function(self) + local equippedItems = getEquippedItems() + print(#equippedItems .. " items equipped") + + for itemSlot, eqItem in pairs(equippedItems) do + local item = self.items[itemSlot] + + if (eqItem.id ~= item.id and eqItem.ilvl ~= item.ilvl) then + print("Unequip " .. itemSlot) + PickupInventoryItem(itemSlot) + PutItemInBag(22) + print("Equip " .. item.id) + EquipItemByName(item.id, itemSlot) + end + end + end + } + + --- @return string + function getItemName(itemLink) + return select(1, GetItemInfo(itemLink)) + end + + --- @return number + function getItemIlvl(itemLink) + return select(4, GetItemInfo(itemLink)) + end + + --- @return string + function getItemType(itemLink) + return select(9, GetItemInfo(itemLink)) + end + + --- @return Item[] + function getEquippedItems() + --- @type Item[] + local items = {} + + for i = 1, 19 do + --- @type Item + local item = Item:new() + --- @type string + local eqItemLink = GetInventoryItemLink("player", i) + --- @type number + local eqItemId = GetInventoryItemID("player", i) + + if (eqItemLink ~= nil) then + item.name = getItemName(eqItemLink) + item.ilvl = getItemIlvl(eqItemLink) + item.type = getItemType(eqItemLink) + item.id = eqItemId + + items[i] = item + end + end + + return items + end + + --- @type ItemSet + local set = ItemSet:new(getEquippedItems()) + set:equip() +end From 054568b2e6462ad40bb6909c3a97e3c62e0ee0e3 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 24 Aug 2024 22:45:28 +0200 Subject: [PATCH 19/27] Update --- .../AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua | 36 +- NewAge/AHBot/EveryFrameThrottled.lua | 10 +- NewAge/AHBot/INIT.lua | 32 +- NewAge/AHBot/Info.txt | 4 +- NewAge/Automation/Eventz.lua | 408 +++++----- NewAge/Automation/INIT.lua | 758 +++++++++--------- NewAge/Automation/LOOT_READY.lua | 136 ++-- NewAge/CataAuraBar/CustomOptions.lua | 38 +- NewAge/CataAuraBar/CustomText.lua | 20 +- NewAge/CataAuraBar/INIT.lua | 614 +++++++------- NewAge/CataAuraBar/INIT_BFA.lua | 632 +++++++-------- NewAge/CataAuraBar/README.md | 20 +- NewAge/CataAuraBar/TSU.lua | 22 +- NewAge/EquipmentManager/INIT.lua | 204 ++--- NewAge/NullBarrier/CLEU1.lua | 18 +- NewAge/NullBarrier/CLEU2.lua | 18 +- NewAge/NullBarrier/CustomDuration1.lua | 4 +- NewAge/NullBarrier/CustomDuration2.lua | 4 +- NewAge/NullBarrier/INIT1.lua | 72 +- NewAge/NullBarrier/INIT2.lua | 6 +- NewAge/NullBarrier/Text1.lua | 4 +- NewAge/OverallAbsorbs/INIT.lua | 80 +- NewAge/PrimaryStatBar/CLEU.lua | 12 +- NewAge/PrimaryStatBar/CustomDuration.lua | 4 +- NewAge/PrimaryStatBar/INIT.lua | 32 +- 25 files changed, 1594 insertions(+), 1594 deletions(-) diff --git a/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua index c3898d1..85ef8c0 100644 --- a/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua +++ b/NewAge/AHBot/AUCTION_HOUSE_BROWSE_RESULTS_UPDATED.lua @@ -1,19 +1,19 @@ -function() - results = C_AuctionHouse.GetBrowseResults() - -- DevTools_Dump(results) - for k,v in ipairs(results) do - local itemID = v.itemKey.itemID - local itemName = GetItemInfo(itemID) - if aura_env.sellPriceThresholds[itemID] then - if v.minPrice > aura_env.sellPriceThresholds[itemID] then - print(itemName, "too expensive") - SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) - end - elseif aura_env.buyPriceThresholds[itemID] then - if v.minPrice < aura_env.buyPriceThresholds[itemID] then - print(itemName, "too cheap") - SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) - end - end - end +function() + results = C_AuctionHouse.GetBrowseResults() + -- DevTools_Dump(results) + for k,v in ipairs(results) do + local itemID = v.itemKey.itemID + local itemName = GetItemInfo(itemID) + if aura_env.sellPriceThresholds[itemID] then + if v.minPrice > aura_env.sellPriceThresholds[itemID] then + print(itemName, "too expensive") + SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) + end + elseif aura_env.buyPriceThresholds[itemID] then + if v.minPrice < aura_env.buyPriceThresholds[itemID] then + print(itemName, "too cheap") + SendChatMessage("POKE", "WHISPER", nil, UnitName("player")) + end + end + end end \ No newline at end of file diff --git a/NewAge/AHBot/EveryFrameThrottled.lua b/NewAge/AHBot/EveryFrameThrottled.lua index 6e30da2..2fafe3f 100644 --- a/NewAge/AHBot/EveryFrameThrottled.lua +++ b/NewAge/AHBot/EveryFrameThrottled.lua @@ -1,6 +1,6 @@ -function() - if not aura_env.last or aura_env.last < GetTime() - aura_env.throttleTime then - aura_env.last = GetTime() - AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() - end +function() + if not aura_env.last or aura_env.last < GetTime() - aura_env.throttleTime then + aura_env.last = GetTime() + AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() + end end \ No newline at end of file diff --git a/NewAge/AHBot/INIT.lua b/NewAge/AHBot/INIT.lua index bcb3b97..e86393b 100644 --- a/NewAge/AHBot/INIT.lua +++ b/NewAge/AHBot/INIT.lua @@ -1,17 +1,17 @@ -aura_env.throttleTime = 10 - -aura_env.sellPriceThresholds = { - [168446] = 5000 * 100 * 100; -- Accord of Critical Strike - [168447] = 5000 * 100 * 100; -- Accord of Haste - [168448] = 5000 * 100 * 100; -- Accord of Mastery - [168449] = 5000 * 100 * 100; -- Accord of Versatility - [168592] = 4500 * 100 * 100; -- Oceanic Restoration - [168496] = 4500 * 100 * 100; -- Force Multiplier - [168593] = 4500 * 100 * 100; -- Machinist's Brilliance - [168598] = 4500 * 100 * 100; -- Naga Hide -} - -aura_env.buyPriceThresholds = { - [152576] = 5 * 100 * 100; -- Tidesrpay Linen - [152877] = 500 * 100 * 100; -- Veiled Crystal +aura_env.throttleTime = 10 + +aura_env.sellPriceThresholds = { + [168446] = 5000 * 100 * 100; -- Accord of Critical Strike + [168447] = 5000 * 100 * 100; -- Accord of Haste + [168448] = 5000 * 100 * 100; -- Accord of Mastery + [168449] = 5000 * 100 * 100; -- Accord of Versatility + [168592] = 4500 * 100 * 100; -- Oceanic Restoration + [168496] = 4500 * 100 * 100; -- Force Multiplier + [168593] = 4500 * 100 * 100; -- Machinist's Brilliance + [168598] = 4500 * 100 * 100; -- Naga Hide +} + +aura_env.buyPriceThresholds = { + [152576] = 5 * 100 * 100; -- Tidesrpay Linen + [152877] = 500 * 100 * 100; -- Veiled Crystal } \ No newline at end of file diff --git a/NewAge/AHBot/Info.txt b/NewAge/AHBot/Info.txt index 599f3f8..d4a3b55 100644 --- a/NewAge/AHBot/Info.txt +++ b/NewAge/AHBot/Info.txt @@ -1,3 +1,3 @@ -/run AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() - +/run AuctionHouseFrame.SearchBar.FavoritesSearchButton:Click() + /dump C_AuctionHouse.GetBrowseResults() \ No newline at end of file diff --git a/NewAge/Automation/Eventz.lua b/NewAge/Automation/Eventz.lua index 007e5a0..a9c580b 100644 --- a/NewAge/Automation/Eventz.lua +++ b/NewAge/Automation/Eventz.lua @@ -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 -function(e) - local aura_env = aura_env - if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot - local slot = 1 - local lootinfo = GetLootInfo() - for k, v in pairs(lootinfo) do - if v.locked == false then - local link = GetLootSlotLink(slot) - local looted = false - 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 - LootSlot(slot) - elseif aura_env.filter[2] == true and link:match("Azerite") then - LootSlot(slot) - elseif aura_env.filter[3] == true and v.item:match("War Resources") then - LootSlot(slot) - elseif aura_env.filter[4] == true and v.item:match("Residuum") then - LootSlot(slot) - elseif aura_env.filter[5] == true and v.item:match("Manapearl") then - LootSlot(slot) - end - if link then - local icon = v.texture - local id = link:match("item:(%d+):") - local type = select(6, GetItemInfo(link)) or "" - local subtype = select(7, GetItemInfo(link)) or "" - local ilvl = select(4, GetItemInfo(link)) or 0 - local equip = select(9, GetItemInfo(link)) - if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then - LootSlot(slot) - elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then - LootSlot(slot) - elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then - LootSlot(slot) - elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then - LootSlot(slot) - elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then - LootSlot(slot) - elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then - LootSlot(slot) - elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then - LootSlot(slot) - elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then - LootSlot(slot) - elseif aura_env.filter[14] == true and v.isQuestItem == true then - LootSlot(slot) - elseif aura_env.filter[15] == true and v.quality == 0 then - LootSlot(slot) - elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then - LootSlot(slot) - elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then - LootSlot(slot) - elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then - LootSlot(slot) - else - 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 - 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 - LootSlot(slot) - end - elseif aura_env.filter[20] == true and type == "Miscellaneous" then - if subtype == "Mount" then - LootSlot(slot) - end - end - end - end - slot = slot + 1 - end - end - --CloseLoot() - elseif e == "EQUIP_BIND_CONFIRM" then - StaticPopup1Button1:Click() - elseif e == "SCRAPPING_MACHINE_SHOW" then - for i = 0, 4 do - for j = 1, GetContainerNumSlots(i) do - local link = select(7, GetContainerItemInfo(i, j)) - if link then - local name = GetItemInfo(link) - local rarity = select(3, GetItemInfo(link)) - local ilvl = select(4, GetItemInfo(link)) or 0 - local type = select(6, GetItemInfo(link)) - local equip = select(9, GetItemInfo(link)) or "" - local price = select(11, GetItemInfo(link)) - if aura_env.sellWhitelist[name] ~= 1 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 - UseContainerItem(i, j) - elseif rarity > 3 and aura_env.getequipID(equip) then - if equip ~= "INVTYPE_FINGER" then - local eqID = aura_env.getequipID(equip) - local elink = GetInventoryItemLink("player", eqID) - local eilvl = select(4, GetItemInfo(elink)) or 0 - if eilvl > ilvl + 5 then - print("Scrapping " .. link .. "over " .. eilvl - ilvl .. " ilvl difference from " .. elink) - UseContainerItem(i, j) - end - elseif equip == "INVTYPE_FINGER" then - local eqID1, eqID2 = 11, 12 - local elink1, elink2 = GetInventoryItemLink("player", eqID1), GetInventoryItemLink("player", eqID2) - local eilvl1, eilvl2 = select(4, GetItemInfo(elink1)) or 0, select(4, GetItemInfo(elink2)) or 0 - if eilvl1 > ilvl + 5 then - print("Scrapping " .. link .. " over " .. eilvl1 - ilvl .. " ilvl difference from " .. elink1) - UseContainerItem(i, j) - elseif eilvl2 > ilvl + 5 then - print("Scrapping " .. link .. " over " .. eilvl2 - ilvl .. " ilvl difference from " .. elink2) - UseContainerItem(i, j) - end - end - end - end - end - end - end - end - elseif e == "MERCHANT_SHOW" then --Sell grey and white wepaon - if CanMerchantRepair() == true then RepairAllItems() end - local i, j = 0, 1 - for c = 0, 4 do - for s = 1, GetContainerNumSlots(c) do - local link = select(7, GetContainerItemInfo(c, s)) - if link then - local name = GetItemInfo(link) - local rarity = select(3, GetItemInfo(link)) - local ilvl = select(4, GetItemInfo(link)) or 0 - local type = select(6, GetItemInfo(link)) - local price = select(11, GetItemInfo(link)) - if price and price > 0 then - if aura_env.sellWhitelist[name] ~= 1 then - if rarity == 0 then - if aura_env.throttleSell == true then - aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} - else - UseContainerItem(c, s) - end - elseif (type == "Armor" or type == "Weapon") and ilvl < 200 then - if aura_env.throttleSell == true then - aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} - else - UseContainerItem(c, s) - end - end - end - end - end - end - end - if aura_env.throttleSell == true then - aura_env.ticker = C_Timer.NewTicker(0.05, function() - if aura_env.toSell[1] then - UseContainerItem(aura_env.toSell[1].c, aura_env.toSell[1].s) - table.remove(aura_env.toSell, 1) - else - aura_env.ticker:Cancel() - end - if j >= GetContainerNumSlots(i) then i = i + 1 - j = 1 end - if i >= 4 then aura_env.ticker:Cancel() end - end) - end - elseif e == "MERCHANT_CLOSED" then - if aura_env.ticker then aura_env.ticker:Cancel() end - aura_env.toSell = {} - elseif e == "QUEST_POI_UPDATE" then - CloseGossip() - elseif e == "QUEST_DETAIL" then - AcceptQuest() - elseif e == "QUEST_COMPLETE" then - if GetNumQuestChoices() <= 1 then - GetQuestReward(1) - end - elseif e == "GOSSIP_SHOW" then - local quests = GetNumGossipAvailableQuests() - local complquests = GetNumGossipActiveQuests() - local opt = GetNumGossipOptions() - if complquests > 0 and opt == 0 then - for i = 1, complquests do - SelectGossipActiveQuest(i) - end - end - if quests > 0 and opt == 0 then - SelectGossipAvailableQuest(1) - end - if opt == 1 and quests + complquests == 0 then - SelectGossipOption(1) - end - elseif e == "QUEST_GREETING" then - local quests = GetNumGossipAvailableQuests() - local complquests = GetNumGossipActiveQuests() - if complquests > 0 then - for i = 1, complquests do - SelectActiveQuest(1) - end - end - if quests > 0 then - SelectAvailableQuest(1) - end - elseif e == "QUEST_PROGRESS" then - if IsQuestCompletable(i) then - CompleteQuest() - end - end +--- 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) + local aura_env = aura_env + if e == "LOOT_READY" or e == "LOOT_OPENED" then --Auto Loot + local slot = 1 + local lootinfo = GetLootInfo() + for k, v in pairs(lootinfo) do + if v.locked == false then + local link = GetLootSlotLink(slot) + local looted = false + 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 + LootSlot(slot) + elseif aura_env.filter[2] == true and link:match("Azerite") then + LootSlot(slot) + elseif aura_env.filter[3] == true and v.item:match("War Resources") then + LootSlot(slot) + elseif aura_env.filter[4] == true and v.item:match("Residuum") then + LootSlot(slot) + elseif aura_env.filter[5] == true and v.item:match("Manapearl") then + LootSlot(slot) + end + if link then + local icon = v.texture + local id = link:match("item:(%d+):") + local type = select(6, GetItemInfo(link)) or "" + local subtype = select(7, GetItemInfo(link)) or "" + local ilvl = select(4, GetItemInfo(link)) or 0 + local equip = select(9, GetItemInfo(link)) + if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then + LootSlot(slot) + elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then + LootSlot(slot) + elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then + LootSlot(slot) + elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then + LootSlot(slot) + elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then + LootSlot(slot) + elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then + LootSlot(slot) + elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then + LootSlot(slot) + elseif aura_env.filter[14] == true and v.isQuestItem == true then + LootSlot(slot) + elseif aura_env.filter[15] == true and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then + LootSlot(slot) + elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then + LootSlot(slot) + elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then + LootSlot(slot) + else + 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 + 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 + LootSlot(slot) + end + elseif aura_env.filter[20] == true and type == "Miscellaneous" then + if subtype == "Mount" then + LootSlot(slot) + end + end + end + end + slot = slot + 1 + end + end + --CloseLoot() + elseif e == "EQUIP_BIND_CONFIRM" then + StaticPopup1Button1:Click() + elseif e == "SCRAPPING_MACHINE_SHOW" then + for i = 0, 4 do + for j = 1, GetContainerNumSlots(i) do + local link = select(7, GetContainerItemInfo(i, j)) + if link then + local name = GetItemInfo(link) + local rarity = select(3, GetItemInfo(link)) + local ilvl = select(4, GetItemInfo(link)) or 0 + local type = select(6, GetItemInfo(link)) + local equip = select(9, GetItemInfo(link)) or "" + local price = select(11, GetItemInfo(link)) + if aura_env.sellWhitelist[name] ~= 1 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 + UseContainerItem(i, j) + elseif rarity > 3 and aura_env.getequipID(equip) then + if equip ~= "INVTYPE_FINGER" then + local eqID = aura_env.getequipID(equip) + local elink = GetInventoryItemLink("player", eqID) + local eilvl = select(4, GetItemInfo(elink)) or 0 + if eilvl > ilvl + 5 then + print("Scrapping " .. link .. "over " .. eilvl - ilvl .. " ilvl difference from " .. elink) + UseContainerItem(i, j) + end + elseif equip == "INVTYPE_FINGER" then + local eqID1, eqID2 = 11, 12 + local elink1, elink2 = GetInventoryItemLink("player", eqID1), GetInventoryItemLink("player", eqID2) + local eilvl1, eilvl2 = select(4, GetItemInfo(elink1)) or 0, select(4, GetItemInfo(elink2)) or 0 + if eilvl1 > ilvl + 5 then + print("Scrapping " .. link .. " over " .. eilvl1 - ilvl .. " ilvl difference from " .. elink1) + UseContainerItem(i, j) + elseif eilvl2 > ilvl + 5 then + print("Scrapping " .. link .. " over " .. eilvl2 - ilvl .. " ilvl difference from " .. elink2) + UseContainerItem(i, j) + end + end + end + end + end + end + end + end + elseif e == "MERCHANT_SHOW" then --Sell grey and white wepaon + if CanMerchantRepair() == true then RepairAllItems() end + local i, j = 0, 1 + for c = 0, 4 do + for s = 1, GetContainerNumSlots(c) do + local link = select(7, GetContainerItemInfo(c, s)) + if link then + local name = GetItemInfo(link) + local rarity = select(3, GetItemInfo(link)) + local ilvl = select(4, GetItemInfo(link)) or 0 + local type = select(6, GetItemInfo(link)) + local price = select(11, GetItemInfo(link)) + if price and price > 0 then + if aura_env.sellWhitelist[name] ~= 1 then + if rarity == 0 then + if aura_env.throttleSell == true then + aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} + else + UseContainerItem(c, s) + end + elseif (type == "Armor" or type == "Weapon") and ilvl < 200 then + if aura_env.throttleSell == true then + aura_env.toSell[#aura_env.toSell + 1] = {["c"] = c, ["s"] = s} + else + UseContainerItem(c, s) + end + end + end + end + end + end + end + if aura_env.throttleSell == true then + aura_env.ticker = C_Timer.NewTicker(0.05, function() + if aura_env.toSell[1] then + UseContainerItem(aura_env.toSell[1].c, aura_env.toSell[1].s) + table.remove(aura_env.toSell, 1) + else + aura_env.ticker:Cancel() + end + if j >= GetContainerNumSlots(i) then i = i + 1 + j = 1 end + if i >= 4 then aura_env.ticker:Cancel() end + end) + end + elseif e == "MERCHANT_CLOSED" then + if aura_env.ticker then aura_env.ticker:Cancel() end + aura_env.toSell = {} + elseif e == "QUEST_POI_UPDATE" then + CloseGossip() + elseif e == "QUEST_DETAIL" then + AcceptQuest() + elseif e == "QUEST_COMPLETE" then + if GetNumQuestChoices() <= 1 then + GetQuestReward(1) + end + elseif e == "GOSSIP_SHOW" then + local quests = GetNumGossipAvailableQuests() + local complquests = GetNumGossipActiveQuests() + local opt = GetNumGossipOptions() + if complquests > 0 and opt == 0 then + for i = 1, complquests do + SelectGossipActiveQuest(i) + end + end + if quests > 0 and opt == 0 then + SelectGossipAvailableQuest(1) + end + if opt == 1 and quests + complquests == 0 then + SelectGossipOption(1) + end + elseif e == "QUEST_GREETING" then + local quests = GetNumGossipAvailableQuests() + local complquests = GetNumGossipActiveQuests() + if complquests > 0 then + for i = 1, complquests do + SelectActiveQuest(1) + end + end + if quests > 0 then + SelectAvailableQuest(1) + end + elseif e == "QUEST_PROGRESS" then + if IsQuestCompletable(i) then + CompleteQuest() + end + end end \ No newline at end of file diff --git a/NewAge/Automation/INIT.lua b/NewAge/Automation/INIT.lua index 5d2439d..5e67227 100644 --- a/NewAge/Automation/INIT.lua +++ b/NewAge/Automation/INIT.lua @@ -1,380 +1,380 @@ -aura_env.debug = true -aura_env.filter = { - [1] = true, --Gold - [2] = true, --Azerite - [3] = true, --War resources - [4] = true, --Residuum - [5] = true, --Manapearls - [6] = true, --Mounts - [7] = true, --High ilvl - [8] = false, --Herbs - [9] = true, --Cooking - [10] = true, --Cloth - [11] = false, --Metal & Stone - [12] = true, --Gold filter greys - [13] = true, -- >1 && <4 quality items, no gear - [14] = true, --Quest items - [15] = true, --All greys - [16] = true, --Whitelist - [17] = true, --Quest items (different filter) - [18] = true, --Class aproperiate >2 items - [19] = true, --Jewelery >2 quality - [20] = true, --Additional mount filter - [21] = true, --Tradeskill // Elemental -} -aura_env.ilvlFilter = 200 -aura_env.goldFilter = 0.5 -aura_env.goldFilter = aura_env.goldFilter * 10000 -aura_env.throttleSell = false - -aura_env.whitelist = { - ["Pygmy Suckerfish"] = 1, - ["Drakkari Offerings"] = 1, - ["Deepcoral Pod"] = 1, - ["Hardened Spring"] = 1, - ["Machined Gear Assembly"] = 1, - ["Tempered Plating"] = 1, - ["Hefty Glimmershell"] = 1, - ["Fresh Meat"] = 1, - ["Wood"] = 1, - - - ["Gloom Dust"] = 1, - ["Veiled Crytal"] = 1, - ["Coalescing Visions"] = 1, - ["Echoes of Ny'alotha"] = 1, - ["Corrupted Mementos"] = 1, - - ["Blood of Sargeras"] = 1, - ["Primal Sargerite"] = 1, - - ["Chain Ignitercoil"] = 1, - ["Galvanic Oscillator"] = 1, - ["Corrupted Memento"] = 1, -} -aura_env.sellWhitelist = { - ["Blacksmith Hammer"] = 1, - ["Endless Tincture of Renewed Combat"] = 1, - ["Mr. Munchykins"] = 1, - ["Arclight Spanner"] = 1, - ["Runeblade of Baron Rivendare"] = 1, -} -aura_env.toSell = {} -aura_env.getequipID = function(equip) - if equip == "INVTYPE_HEAD" then return 1 - elseif equip == "INVTYPE_NECK" then return 2 - elseif equip == "INVTYPE_SHOULDER" then return 3 - elseif equip == "INVTYPE_BODY" then return 4 - elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5 - elseif equip == "INVTYPE_WAIST" then return 6 - elseif equip == "INVTYPE_LEGS" then return 7 - elseif equip == "INVTYPE_FEET" then return 8 - elseif equip == "INVTYPE_WRIST" then return 9 - elseif equip == "INVTYPE_HAND" then return 10 - 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_SHIELD" then return 17 - else return nil end -end -aura_env.skills = { - --Warrior - [1] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 1, - ["Guns"] = 1, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 1, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 1, - ["Wands"] = 0, - }, - --Paladin - [2] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 0, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Hunter - [3] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 1, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 1, - ["Guns"] = 1, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 1, - ["Wands"] = 0, - }, - --Rogue - [4] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Priest - [5] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Death Knight - [6] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 0, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Shaman - [7] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 1, - ["Plate"] = 0, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Mage - [8] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Warlock - [9] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Monk - [10] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Druid - [11] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Demon Hunter - [12] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 1, - ["Staves"] = 0, - ["Fist Weapons"] = 1, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, +aura_env.debug = true +aura_env.filter = { + [1] = true, --Gold + [2] = true, --Azerite + [3] = true, --War resources + [4] = true, --Residuum + [5] = true, --Manapearls + [6] = true, --Mounts + [7] = true, --High ilvl + [8] = false, --Herbs + [9] = true, --Cooking + [10] = true, --Cloth + [11] = false, --Metal & Stone + [12] = true, --Gold filter greys + [13] = true, -- >1 && <4 quality items, no gear + [14] = true, --Quest items + [15] = true, --All greys + [16] = true, --Whitelist + [17] = true, --Quest items (different filter) + [18] = true, --Class aproperiate >2 items + [19] = true, --Jewelery >2 quality + [20] = true, --Additional mount filter + [21] = true, --Tradeskill // Elemental +} +aura_env.ilvlFilter = 200 +aura_env.goldFilter = 0.5 +aura_env.goldFilter = aura_env.goldFilter * 10000 +aura_env.throttleSell = false + +aura_env.whitelist = { + ["Pygmy Suckerfish"] = 1, + ["Drakkari Offerings"] = 1, + ["Deepcoral Pod"] = 1, + ["Hardened Spring"] = 1, + ["Machined Gear Assembly"] = 1, + ["Tempered Plating"] = 1, + ["Hefty Glimmershell"] = 1, + ["Fresh Meat"] = 1, + ["Wood"] = 1, + + + ["Gloom Dust"] = 1, + ["Veiled Crytal"] = 1, + ["Coalescing Visions"] = 1, + ["Echoes of Ny'alotha"] = 1, + ["Corrupted Mementos"] = 1, + + ["Blood of Sargeras"] = 1, + ["Primal Sargerite"] = 1, + + ["Chain Ignitercoil"] = 1, + ["Galvanic Oscillator"] = 1, + ["Corrupted Memento"] = 1, +} +aura_env.sellWhitelist = { + ["Blacksmith Hammer"] = 1, + ["Endless Tincture of Renewed Combat"] = 1, + ["Mr. Munchykins"] = 1, + ["Arclight Spanner"] = 1, + ["Runeblade of Baron Rivendare"] = 1, +} +aura_env.toSell = {} +aura_env.getequipID = function(equip) + if equip == "INVTYPE_HEAD" then return 1 + elseif equip == "INVTYPE_NECK" then return 2 + elseif equip == "INVTYPE_SHOULDER" then return 3 + elseif equip == "INVTYPE_BODY" then return 4 + elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5 + elseif equip == "INVTYPE_WAIST" then return 6 + elseif equip == "INVTYPE_LEGS" then return 7 + elseif equip == "INVTYPE_FEET" then return 8 + elseif equip == "INVTYPE_WRIST" then return 9 + elseif equip == "INVTYPE_HAND" then return 10 + 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_SHIELD" then return 17 + else return nil end +end +aura_env.skills = { + --Warrior + [1] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 1, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Paladin + [2] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Hunter + [3] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Rogue + [4] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Priest + [5] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Death Knight + [6] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Shaman + [7] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Mage + [8] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Warlock + [9] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Monk + [10] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Druid + [11] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Demon Hunter + [12] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 1, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, } \ No newline at end of file diff --git a/NewAge/Automation/LOOT_READY.lua b/NewAge/Automation/LOOT_READY.lua index dc26120..d4bb2e2 100644 --- a/NewAge/Automation/LOOT_READY.lua +++ b/NewAge/Automation/LOOT_READY.lua @@ -1,69 +1,69 @@ --- LOOT_READY LOOT_OPENED - -function(e, ...) - local slot = 1 - local lootinfo = GetLootInfo() - for k, v in pairs(lootinfo) do - if v.locked == false then - local link = GetLootSlotLink(slot) - 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 - LootSlot(slot) - elseif aura_env.filter[2] == true and link:match("Azerite") then - LootSlot(slot) - elseif aura_env.filter[3] == true and v.item:match("War Resources") then - LootSlot(slot) - elseif aura_env.filter[4] == true and v.item:match("Residuum") then - LootSlot(slot) - elseif aura_env.filter[5] == true and v.item:match("Manapearl") then - LootSlot(slot) - end - if link then - local type = select(6, GetItemInfo(link)) or "" - local subtype = select(7, GetItemInfo(link)) or "" - local ilvl = select(4, GetItemInfo(link)) or 0 - local equip = select(9, GetItemInfo(link)) - if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then - LootSlot(slot) - elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then - LootSlot(slot) - elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then - LootSlot(slot) - elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then - LootSlot(slot) - elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then - LootSlot(slot) - elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then - LootSlot(slot) - elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then - LootSlot(slot) - elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then - LootSlot(slot) - elseif aura_env.filter[14] == true and v.isQuestItem == true then - LootSlot(slot) - elseif aura_env.filter[15] == true and v.quality == 0 then - LootSlot(slot) - elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then - LootSlot(slot) - elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then - LootSlot(slot) - elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then - LootSlot(slot) - else - 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 - 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 - LootSlot(slot) - end - elseif aura_env.filter[20] == true and type == "Miscellaneous" then - if subtype == "Mount" then - LootSlot(slot) - end - end - end - end - slot = slot + 1 - end - end +-- LOOT_READY LOOT_OPENED + +function(e, ...) + local slot = 1 + local lootinfo = GetLootInfo() + for k, v in pairs(lootinfo) do + if v.locked == false then + local link = GetLootSlotLink(slot) + 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 + LootSlot(slot) + elseif aura_env.filter[2] == true and link:match("Azerite") then + LootSlot(slot) + elseif aura_env.filter[3] == true and v.item:match("War Resources") then + LootSlot(slot) + elseif aura_env.filter[4] == true and v.item:match("Residuum") then + LootSlot(slot) + elseif aura_env.filter[5] == true and v.item:match("Manapearl") then + LootSlot(slot) + end + if link then + local type = select(6, GetItemInfo(link)) or "" + local subtype = select(7, GetItemInfo(link)) or "" + local ilvl = select(4, GetItemInfo(link)) or 0 + local equip = select(9, GetItemInfo(link)) + if aura_env.filter[6] == true and (select(7, GetItemInfo(link)) or 0) == "Mount" then + LootSlot(slot) + elseif aura_env.filter[7] == true and ilvl > aura_env.ilvlFilter then + LootSlot(slot) + elseif aura_env.filter[8] == true and (select(7, GetItemInfo(link)) or 0) == "Herb" then + LootSlot(slot) + elseif aura_env.filter[9] == true and (select(7, GetItemInfo(link)) or 0) == "Cooking" then + LootSlot(slot) + elseif aura_env.filter[10] == true and (select(7, GetItemInfo(link)) or 0) == "Cloth" and type == "Tradeskill" then + LootSlot(slot) + elseif aura_env.filter[11] == true and (select(7, GetItemInfo(link)) or 0) == "Metal & Stone" then + LootSlot(slot) + elseif aura_env.filter[12] == true and (select(11, GetItemInfo(link)) or 0) > aura_env.goldFilter and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[13] == true and v.quality > 1 and v.quality < 4 and type ~= "Weapon" and type ~= "Armor" then + LootSlot(slot) + elseif aura_env.filter[14] == true and v.isQuestItem == true then + LootSlot(slot) + elseif aura_env.filter[15] == true and v.quality == 0 then + LootSlot(slot) + elseif aura_env.filter[16] == true and aura_env.whitelist[v.item] then + LootSlot(slot) + elseif aura_env.filter[17] == true and type == "Quest" and subtype == "Quest" then + LootSlot(slot) + elseif aura_env.filter[21] == true and type == "Tradeskill" and subtype == "Elemental" then + LootSlot(slot) + else + 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 + 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 + LootSlot(slot) + end + elseif aura_env.filter[20] == true and type == "Miscellaneous" then + if subtype == "Mount" then + LootSlot(slot) + end + end + end + end + slot = slot + 1 + end + end end \ No newline at end of file diff --git a/NewAge/CataAuraBar/CustomOptions.lua b/NewAge/CataAuraBar/CustomOptions.lua index 462869e..276c13d 100644 --- a/NewAge/CataAuraBar/CustomOptions.lua +++ b/NewAge/CataAuraBar/CustomOptions.lua @@ -1,20 +1,20 @@ -{ - IsOnCooldown = { - type = "bool", - test = function(state, needle) - return state.IsOnCooldown == (needle == 1) - end, - }, - IsActive = { - type = "bool", - test = function(state, needle) - return state.IsActive == (needle == 1) - end, - }, - IsDebuff = { - type = "bool", - test = function(state, needle) - return state.IsBad == (needle == 1) - end, - }, +{ + IsOnCooldown = { + type = "bool", + test = function(state, needle) + return state.IsOnCooldown == (needle == 1) + end, + }, + IsActive = { + type = "bool", + test = function(state, needle) + return state.IsActive == (needle == 1) + end, + }, + IsDebuff = { + type = "bool", + test = function(state, needle) + return state.IsBad == (needle == 1) + end, + }, } \ No newline at end of file diff --git a/NewAge/CataAuraBar/CustomText.lua b/NewAge/CataAuraBar/CustomText.lua index 5fc5c1a..2240411 100644 --- a/NewAge/CataAuraBar/CustomText.lua +++ b/NewAge/CataAuraBar/CustomText.lua @@ -1,11 +1,11 @@ -function() - if aura_env.state.pname then - output = "" - if aura_env.state.pclass then - output = aura_env.GetClassColor(aura_env.state.pclass) .. aura_env.state.pname .. "\124r" - else - output = aura_env.state.pname - end - return output - end +function() + if aura_env.statee.pname then + output = "" + if aura_env.statee.pclass then + output = aura_env.GetClassColor(aura_env.statee.pclass) .. aura_env.statee.pname .. "\124r" + else + output = aura_env.statee.pname + end + return output + end end \ No newline at end of file diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index 391db19..fa28845 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -1,308 +1,308 @@ -local function StrSplit(inputString, separator) - local outputTable = {} - for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do - outputTable[#outputTable + 1] = str - end - return outputTable -end - -local function PrintTable(table) - for k,v in pairs(table) do - print(k .. " " .. v) - end -end - -aura_env.GetClassColor = function(class) - if class == "Death Knight" then - return "\124cFFC41E3A" - elseif class == "Druid" then - return "\124cFFFF7C0A" - elseif class == "Hunter" then - return "\124cFFAAD372" - elseif class == "Mage" then - return "\124cFF3FC7EB" - elseif class == "Paladin" then - return "\124cFFF48CBA" - elseif class == "Priest" then - return "\124cFFFFFFFF" - elseif class == "Rogue" then - return "\124cFFFFF468" - elseif class == "Shaman" then - return "\124cFF0070DD" - elseif class == "Warlock" then - return "\124cFF8788EE" - elseif class == "Warrior" then - return "\124cFFC69B6D" - end -end - -local Unit = { - New = function(self, unit) - o = { - ["unit"] = unit, - } - setmetatable(o, self) - self.__index = self - return o - end, - - GetAuras = function(self, auraFunc, name, type) - return nil - end, -} -local BasicUnit = Unit:New("player") -function BasicUnit:GetAuras(auraFunc, name) - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) - if aura ~= nil then - return { - [UnitName(self.unit)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - } - else - return {} - end -end --- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New("group") -function GroupUnit:GetAuras(auraFunc, name) - local raidMem = GetNumRaidMembers() - local num = GetNumPartyMembers() - local unitPrefix = "party" - if raidMem > num then - unitPrefix = "raid" - num = raidMem - end - auras = {} - for i = 1, num do - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - if aura ~= nil then - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - if unitPrefix == "party" then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) - if aura ~= nil then - auras[UnitName("player")] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - return auras -end --- Nameplate does not work, find out why? -local NameplateUnit = Unit:New("nameplate") -function NameplateUnit:GetAuras(auraFunc, name) - local unitPrefix = "nameplate" - auras = {} - for i = 1, 40 do - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) - if aura ~= nil then - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - end - end - return auras -end - -local UnitFactory = { - New = function(self) - o = {} - setmetatable(o, self) - self.__index = self - return o - end, - - CreateUnit = function(self, target) - target = string.lower(target) - if target == "player" or target == "target" or target == "focus" then - return BasicUnit:New(target) - elseif target == "group" then - return GroupUnit:New(target) - elseif target == "nameplate" then - return NameplateUnit:New(target) - end - end, -} -local unitFactory = UnitFactory:New() - -local Aura = { - New = function(self, entry, index) - o = { - ["name"] = entry.auraName, - ["unit"] = entry.target, - ["hasCooldown"] = entry.hasCooldown, - ["index"] = index, - ["GetAura"] = entry.GetAura, - } - setmetatable(o, self) - self.__index = self - return o - end, - - IsActive = function(self) - for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do - for k2, v2 in pairs(v) do - end - return true - end - return false - end, - IsOnCooldown = function(self) - if not self.hasCooldown then - return false - end - return GetSpellCooldown(self.name) > 0 - end, - - AddAsAura = function(self, allstates) - local auras = self.unit:GetAuras(self.GetAura, self.name) - for k,v in pairs(auras) do - duration = v.duration - expirationTime = v.expirationTime - icon = self:GetAuraIcon(v.spellID) - allstates[self.name .. k] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = expirationTime, - index = self.index, - icon = icon, - pname = k, - stacks = v.stacks, - pclass = v.class, - IsOnCooldown = true, - IsActive = true, - IsBad = self.GetAura == UnitDebuff, - } - end - end, - AddAsCooldown = function(self, allstates) - if not self.hasCooldown then - return false - end - startTime, duration = GetSpellCooldown(self.name) - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = startTime + duration, - index = self.index, - icon = icon, - IsOnCooldown = true, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - AddAsIcon = function(self, allstates) - if not self.hasCooldown then - return false - end - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "static", - value = 1, - total = 1, - index = self.index, - icon = icon, - IsOnCooldown = false, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - - GetSpellIcon = function(self) - return select(3, GetSpellInfo(self.name)) - end, - GetAuraIcon = function(self, spellID) - return select(3, GetSpellInfo(spellID)) - end, -} - -local Entry = { - New = function(self, entry) - entry = self:TrimWhitespace(entry) - - local entryData = StrSplit(entry, ",") - local name = self:ReadEntryData(entryData, 1) - local type = self:ReadEntryData(entryData, 2) or "Buff" - local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") - local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false - cooldown = not cooldown - local GetAura = UnitBuff - - if type == "Debuff" then GetAura = UnitDebuff end - - o = { - ["entry"] = entry, - ["auraName"] = name, - ["GetAura"] = GetAura, - ["target"] = target, - ["hasCooldown"] = cooldown, - } - setmetatable(o, self) - self.__index = self - return o - end, - - ReadEntryData = function(self, entryData, index) - local str = entryData[index] - if str == nil then - return nil - end - str = self:TrimWhitespace(str) - return str - end, - - TrimWhitespace = function(self, str) - str = str:gsub("^[ ]+", "") - str = str:gsub("\n$", "") - str = str:gsub("[ ]+$", "") - return str - end, -} - -aura_env.auras = {} -for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do - entry = Entry:New(entry) - - auraObj = Aura:New(entry, #aura_env.auras + 1) - aura_env.auras[#aura_env.auras + 1] = auraObj -end - -aura_env.HandleEvent = function(allstates) - for k, v in ipairs(aura_env.auras) do - if v:IsActive() then - v:AddAsAura(allstates) - elseif v:IsOnCooldown() and not v:IsActive() then - v:AddAsCooldown(allstates) - elseif not v:IsOnCooldown() and not v:IsActive() then - v:AddAsIcon(allstates) - end - end +local function StrSplit(inputString, separator) + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable +end + +local function PrintTable(table) + for k,v in pairs(table) do + print(k .. " " .. v) + end +end + +aura_env.GetClassColor = function(class) + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end +end + +local Unit = { + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, + + GetAuras = function(self, auraFunc, name, type) + return nil + end, +} +local BasicUnit = Unit:New("player") +function BasicUnit:GetAuras(auraFunc, name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + } + else + return {} + end +end +-- Maybe implement some sort of throttle to group unit? +local GroupUnit = Unit:New("group") +function GroupUnit:GetAuras(auraFunc, name) + local raidMem = GetNumRaidMembers() + local num = GetNumPartyMembers() + local unitPrefix = "party" + if raidMem > num then + unitPrefix = "raid" + num = raidMem + end + auras = {} + for i = 1, num do + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + if unitPrefix == "party" then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + if aura ~= nil then + auras[UnitName("player")] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + return auras +end +-- Nameplate does not work, find out why? +local NameplateUnit = Unit:New("nameplate") +function NameplateUnit:GetAuras(auraFunc, name) + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + end + end + return auras +end + +local UnitFactory = { + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, + + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, +} +local unitFactory = UnitFactory:New() + +local Aura = { + New = function(self, entry, index) + o = { + ["name"] = entry.auraName, + ["unit"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, + } + setmetatable(o, self) + self.__index = self + return o + end, + + IsActive = function(self) + for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + for k2, v2 in pairs(v) do + end + return true + end + return false + end, + IsOnCooldown = function(self) + if not self.hasCooldown then + return false + end + return GetSpellCooldown(self.name) > 0 + end, + + AddAsAura = function(self, allstates) + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k,v in pairs(auras) do + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + stacks = v.stacks, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end + end, + AddAsCooldown = function(self, allstates) + if not self.hasCooldown then + return false + end + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + AddAsIcon = function(self, allstates) + if not self.hasCooldown then + return false + end + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + + GetSpellIcon = function(self) + return select(3, GetSpellInfo(self.name)) + end, + GetAuraIcon = function(self, spellID) + return select(3, GetSpellInfo(spellID)) + end, +} + +local Entry = { + New = function(self, entry) + entry = self:TrimWhitespace(entry) + + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff + + if type == "Debuff" then GetAura = UnitDebuff end + + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, + + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then + return nil + end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, +} + +aura_env.auras = {} +for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do + entry = Entry:New(entry) + + auraObj = Aura:New(entry, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj +end + +aura_env.HandleEvent = function(allstates) + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end end \ No newline at end of file diff --git a/NewAge/CataAuraBar/INIT_BFA.lua b/NewAge/CataAuraBar/INIT_BFA.lua index 3da4350..0157b4c 100644 --- a/NewAge/CataAuraBar/INIT_BFA.lua +++ b/NewAge/CataAuraBar/INIT_BFA.lua @@ -1,317 +1,317 @@ -local function StrSplit(inputString, separator) - local outputTable = {} - for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do - outputTable[#outputTable + 1] = str - end - return outputTable -end - -local function PrintTable(table) - for k,v in pairs(table) do - print(k .. " " .. v) - end -end - -local function GetAuraIndex(func, unit, name) - for i = 1, 40 do - local aura = func(unit, i) - if aura == "name" then return i end - if aura == nil then return 0 end - end - return 0 -end - -aura_env.GetClassColor = function(class) - if class == "Death Knight" then - return "\124cFFC41E3A" - elseif class == "Druid" then - return "\124cFFFF7C0A" - elseif class == "Hunter" then - return "\124cFFAAD372" - elseif class == "Mage" then - return "\124cFF3FC7EB" - elseif class == "Paladin" then - return "\124cFFF48CBA" - elseif class == "Priest" then - return "\124cFFFFFFFF" - elseif class == "Rogue" then - return "\124cFFFFF468" - elseif class == "Shaman" then - return "\124cFF0070DD" - elseif class == "Warlock" then - return "\124cFF8788EE" - elseif class == "Warrior" then - return "\124cFFC69B6D" - end -end - -local Unit = { - New = function(self, unit) - o = { - ["unit"] = unit, - } - setmetatable(o, self) - self.__index = self - return o - end, - - GetAuras = function(self, auraFunc, name, type) - return nil - end, -} -local BasicUnit = Unit:New("player") -function BasicUnit:GetAuras(auraFunc, name) - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) - if aura ~= nil then - return { - [UnitName(self.unit)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - } - else - return {} - end -end --- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New("group") -function GroupUnit:GetAuras(auraFunc, name) - local num = GetNumGroupMembers() - local unitPrefix = "party" - if IsInRaid() then - unitPrefix = "raid" - end - auras = {} - for i = 1, num do - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) - if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex) - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - if unitPrefix == "party" then - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) - local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) - auras[UnitName("player")] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - return auras -end --- Nameplate does not work, find out why? -local NameplateUnit = Unit:New("nameplate") -function NameplateUnit:GetAuras(auraFunc, name) - local unitPrefix = "nameplate" - auras = {} - for i = 1, 40 do - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - end - end - return auras -end - -local UnitFactory = { - New = function(self) - o = {} - setmetatable(o, self) - self.__index = self - return o - end, - - CreateUnit = function(self, target) - target = string.lower(target) - if target == "player" or target == "target" or target == "focus" then - return BasicUnit:New(target) - elseif target == "group" then - return GroupUnit:New(target) - elseif target == "nameplate" then - return NameplateUnit:New(target) - end - end, -} -local unitFactory = UnitFactory:New() - -local Aura = { - New = function(self, entry, index) - o = { - ["name"] = entry.auraName, - ["unit"] = entry.target, - ["hasCooldown"] = entry.hasCooldown, - ["index"] = index, - ["GetAura"] = entry.GetAura, - } - setmetatable(o, self) - self.__index = self - return o - end, - - IsActive = function(self) - for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do - return true - end - return false - end, - IsOnCooldown = function(self) - if not self.hasCooldown then - return false - end - return GetSpellCooldown(self.name) > 0 - end, - - AddAsAura = function(self, allstates) - local auras = self.unit:GetAuras(self.GetAura, self.name) - for k,v in pairs(auras) do - duration = v.duration - expirationTime = v.expirationTime - icon = self:GetAuraIcon(v.spellID) - allstates[self.name .. k] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = expirationTime, - index = self.index, - icon = icon, - pname = k, - stacks = v.stacks, - pclass = v.class, - IsOnCooldown = true, - IsActive = true, - IsBad = self.GetAura == UnitDebuff, - } - end - end, - AddAsCooldown = function(self, allstates) - if not self.hasCooldown then - return false - end - startTime, duration = GetSpellCooldown(self.name) - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = startTime + duration, - index = self.index, - icon = icon, - IsOnCooldown = true, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - AddAsIcon = function(self, allstates) - if not self.hasCooldown then - return false - end - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "static", - value = 1, - total = 1, - index = self.index, - icon = icon, - IsOnCooldown = false, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - - GetSpellIcon = function(self) - return select(3, GetSpellInfo(self.name)) - end, - GetAuraIcon = function(self, spellID) - return select(3, GetSpellInfo(spellID)) - end, -} - -local Entry = { - New = function(self, entry) - entry = self:TrimWhitespace(entry) - - local entryData = StrSplit(entry, ",") - local name = self:ReadEntryData(entryData, 1) - local type = self:ReadEntryData(entryData, 2) or "Buff" - local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") - local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false - cooldown = not cooldown - local GetAura = UnitBuff - - if type == "Debuff" then GetAura = UnitDebuff end - - o = { - ["entry"] = entry, - ["auraName"] = name, - ["GetAura"] = GetAura, - ["target"] = target, - ["hasCooldown"] = cooldown, - } - setmetatable(o, self) - self.__index = self - return o - end, - - ReadEntryData = function(self, entryData, index) - local str = entryData[index] - if str == nil then - return nil - end - str = self:TrimWhitespace(str) - return str - end, - - TrimWhitespace = function(self, str) - str = str:gsub("^[ ]+", "") - str = str:gsub("\n$", "") - str = str:gsub("[ ]+$", "") - return str - end, -} - -aura_env.auras = {} -for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do - entry = Entry:New(entry) - - auraObj = Aura:New(entry, #aura_env.auras + 1) - aura_env.auras[#aura_env.auras + 1] = auraObj -end - -aura_env.HandleEvent = function(allstates) - for k, v in ipairs(aura_env.auras) do - if v:IsActive() then - v:AddAsAura(allstates) - elseif v:IsOnCooldown() and not v:IsActive() then - v:AddAsCooldown(allstates) - elseif not v:IsOnCooldown() and not v:IsActive() then - v:AddAsIcon(allstates) - end - end +local function StrSplit(inputString, separator) + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable +end + +local function PrintTable(table) + for k,v in pairs(table) do + print(k .. " " .. v) + end +end + +local function GetAuraIndex(func, unit, name) + for i = 1, 40 do + local aura = func(unit, i) + if aura == "name" then return i end + if aura == nil then return 0 end + end + return 0 +end + +aura_env.GetClassColor = function(class) + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end +end + +local Unit = { + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, + + GetAuras = function(self, auraFunc, name, type) + return nil + end, +} +local BasicUnit = Unit:New("player") +function BasicUnit:GetAuras(auraFunc, name) + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + } + else + return {} + end +end +-- Maybe implement some sort of throttle to group unit? +local GroupUnit = Unit:New("group") +function GroupUnit:GetAuras(auraFunc, name) + local num = GetNumGroupMembers() + local unitPrefix = "party" + if IsInRaid() then + unitPrefix = "raid" + end + auras = {} + for i = 1, num do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) + if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + if unitPrefix == "party" then + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName("player")] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + return auras +end +-- Nameplate does not work, find out why? +local NameplateUnit = Unit:New("nameplate") +function NameplateUnit:GetAuras(auraFunc, name) + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + end + end + return auras +end + +local UnitFactory = { + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, + + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, +} +local unitFactory = UnitFactory:New() + +local Aura = { + New = function(self, entry, index) + o = { + ["name"] = entry.auraName, + ["unit"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, + } + setmetatable(o, self) + self.__index = self + return o + end, + + IsActive = function(self) + for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + return true + end + return false + end, + IsOnCooldown = function(self) + if not self.hasCooldown then + return false + end + return GetSpellCooldown(self.name) > 0 + end, + + AddAsAura = function(self, allstates) + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k,v in pairs(auras) do + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + stacks = v.stacks, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end + end, + AddAsCooldown = function(self, allstates) + if not self.hasCooldown then + return false + end + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + AddAsIcon = function(self, allstates) + if not self.hasCooldown then + return false + end + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + + GetSpellIcon = function(self) + return select(3, GetSpellInfo(self.name)) + end, + GetAuraIcon = function(self, spellID) + return select(3, GetSpellInfo(spellID)) + end, +} + +local Entry = { + New = function(self, entry) + entry = self:TrimWhitespace(entry) + + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff + + if type == "Debuff" then GetAura = UnitDebuff end + + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, + + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then + return nil + end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, +} + +aura_env.auras = {} +for entry in string.gmatch(aura_env.config.spellList, "([a-zA-Z,0-9 ]+)") do + entry = Entry:New(entry) + + auraObj = Aura:New(entry, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj +end + +aura_env.HandleEvent = function(allstates) + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end end \ No newline at end of file diff --git a/NewAge/CataAuraBar/README.md b/NewAge/CataAuraBar/README.md index 528ead0..4d6179b 100644 --- a/NewAge/CataAuraBar/README.md +++ b/NewAge/CataAuraBar/README.md @@ -1,11 +1,11 @@ -## While aura is active show aura - -## While aura is inactive and off cooldown show icon - -## While aura is inactive and on cooldown show cooldown - -## Use tsu - -### ACTIONBAR_UPDATE_COOLDOWN when anything on bar goes on cooldown - +## While aura is active show aura + +## While aura is inactive and off cooldown show icon + +## While aura is inactive and on cooldown show cooldown + +## Use tsu + +### ACTIONBAR_UPDATE_COOLDOWN when anything on bar goes on cooldown + ### UNIT_AURA with one argument which is unit when aura fades/gets applied \ No newline at end of file diff --git a/NewAge/CataAuraBar/TSU.lua b/NewAge/CataAuraBar/TSU.lua index 704ff7c..932438c 100644 --- a/NewAge/CataAuraBar/TSU.lua +++ b/NewAge/CataAuraBar/TSU.lua @@ -1,12 +1,12 @@ -function(allstates, e, ...) - for _,v in pairs(allstates) do - v.show = false - v.changed = true - end - - aura_env.HandleEvent(allstates) - return true -end - --- /run WeakAuras.ScanEvents("SPELL_UPDATE_COOLDOWN") +function(allstates, e, ...) + for _,v in pairs(allstates) do + v.show = false + v.changed = true + end + + aura_env.HandleEvent(allstates) + return true +end + +-- /run WeakAuras.ScanEvents("SPELL_UPDATE_COOLDOWN") -- /dump UnitAura("player", "Blessing of Might") \ No newline at end of file diff --git a/NewAge/EquipmentManager/INIT.lua b/NewAge/EquipmentManager/INIT.lua index 5d3f7f8..9e16570 100644 --- a/NewAge/EquipmentManager/INIT.lua +++ b/NewAge/EquipmentManager/INIT.lua @@ -1,102 +1,102 @@ -function() - --- @class Item - --- @field id number - --- @field name string - --- @field ilvl number - --- @field type string - - --- @field new function - Item = { - --- @param self Item - --- @return Item - new = function(self) - local obj = {} - obj.id = id or -1 - obj.name = name or "" - obj.ilvl = ilvl or -1 - obj.type = type or "" - setmetatable(obj, self) - self.__index = self - return obj - end, - } - - --- @class ItemSet - --- @field items Item[] - - --- @field new function - --- @field equip function - ItemSet = { - --- @param self ItemSet - --- @return ItemSet - new = function(self, items) - local obj = {} - obj.items = items or {} - setmetatable(obj, self) - self.__index = self - return obj - end, - - equip = function(self) - local equippedItems = getEquippedItems() - print(#equippedItems .. " items equipped") - - for itemSlot, eqItem in pairs(equippedItems) do - local item = self.items[itemSlot] - - if (eqItem.id ~= item.id and eqItem.ilvl ~= item.ilvl) then - print("Unequip " .. itemSlot) - PickupInventoryItem(itemSlot) - PutItemInBag(22) - print("Equip " .. item.id) - EquipItemByName(item.id, itemSlot) - end - end - end - } - - --- @return string - function getItemName(itemLink) - return select(1, GetItemInfo(itemLink)) - end - - --- @return number - function getItemIlvl(itemLink) - return select(4, GetItemInfo(itemLink)) - end - - --- @return string - function getItemType(itemLink) - return select(9, GetItemInfo(itemLink)) - end - - --- @return Item[] - function getEquippedItems() - --- @type Item[] - local items = {} - - for i = 1, 19 do - --- @type Item - local item = Item:new() - --- @type string - local eqItemLink = GetInventoryItemLink("player", i) - --- @type number - local eqItemId = GetInventoryItemID("player", i) - - if (eqItemLink ~= nil) then - item.name = getItemName(eqItemLink) - item.ilvl = getItemIlvl(eqItemLink) - item.type = getItemType(eqItemLink) - item.id = eqItemId - - items[i] = item - end - end - - return items - end - - --- @type ItemSet - local set = ItemSet:new(getEquippedItems()) - set:equip() -end +function() + --- @class Item + --- @field id number + --- @field name string + --- @field ilvl number + --- @field type string + + --- @field new function + Item = { + --- @param self Item + --- @return Item + new = function(self) + local obj = {} + obj.id = id or -1 + obj.name = name or "" + obj.ilvl = ilvl or -1 + obj.type = type or "" + setmetatable(obj, self) + self.__index = self + return obj + end, + } + + --- @class ItemSet + --- @field items Item[] + + --- @field new function + --- @field equip function + ItemSet = { + --- @param self ItemSet + --- @return ItemSet + new = function(self, items) + local obj = {} + obj.items = items or {} + setmetatable(obj, self) + self.__index = self + return obj + end, + + equip = function(self) + local equippedItems = getEquippedItems() + print(#equippedItems .. " items equipped") + + for itemSlot, eqItem in pairs(equippedItems) do + local item = self.items[itemSlot] + + if (eqItem.id ~= item.id and eqItem.ilvl ~= item.ilvl) then + print("Unequip " .. itemSlot) + PickupInventoryItem(itemSlot) + PutItemInBag(22) + print("Equip " .. item.id) + EquipItemByName(item.id, itemSlot) + end + end + end + } + + --- @return string + function getItemName(itemLink) + return select(1, GetItemInfo(itemLink)) + end + + --- @return number + function getItemIlvl(itemLink) + return select(4, GetItemInfo(itemLink)) + end + + --- @return string + function getItemType(itemLink) + return select(9, GetItemInfo(itemLink)) + end + + --- @return Item[] + function getEquippedItems() + --- @type Item[] + local items = {} + + for i = 1, 19 do + --- @type Item + local item = Item:new() + --- @type string + local eqItemLink = GetInventoryItemLink("player", i) + --- @type number + local eqItemId = GetInventoryItemID("player", i) + + if (eqItemLink ~= nil) then + item.name = getItemName(eqItemLink) + item.ilvl = getItemIlvl(eqItemLink) + item.type = getItemType(eqItemLink) + item.id = eqItemId + + items[i] = item + end + end + + return items + end + + --- @type ItemSet + local set = ItemSet:new(getEquippedItems()) + set:equip() +end diff --git a/NewAge/NullBarrier/CLEU1.lua b/NewAge/NullBarrier/CLEU1.lua index 68ec099..01cc500 100644 --- a/NewAge/NullBarrier/CLEU1.lua +++ b/NewAge/NullBarrier/CLEU1.lua @@ -1,10 +1,10 @@ -function() - if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then - local target = select(5, CombatLogGetCurrentEventInfo()) - local buff = select(13, CombatLogGetCurrentEventInfo()) - if target == UnitName("player") and aura_env.buffs[buff] ~= nil then - aura_env.max = aura_env.GetAbsorbs() - end - end - return aura_env.GetAbsorbs() > 0 +function() + if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then + local target = select(5, CombatLogGetCurrentEventInfo()) + local buff = select(13, CombatLogGetCurrentEventInfo()) + if target == UnitName("player") and aura_env.buffs[buff] ~= nil then + aura_env.max = aura_env.GetAbsorbs() + end + end + return aura_env.GetAbsorbs() > 0 end \ No newline at end of file diff --git a/NewAge/NullBarrier/CLEU2.lua b/NewAge/NullBarrier/CLEU2.lua index ea53242..c5a705e 100644 --- a/NewAge/NullBarrier/CLEU2.lua +++ b/NewAge/NullBarrier/CLEU2.lua @@ -1,10 +1,10 @@ -function() - if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then - local target = select(5, CombatLogGetCurrentEventInfo()) - local buff = select(13, CombatLogGetCurrentEventInfo()) - if target == UnitName("player") and aura_env.buffs[buff] ~= nil then - aura_env.timeApplied = GetTime() - return true - end - end +function() + if select(2, CombatLogGetCurrentEventInfo()) == "SPELL_AURA_APPLIED" then + local target = select(5, CombatLogGetCurrentEventInfo()) + local buff = select(13, CombatLogGetCurrentEventInfo()) + if target == UnitName("player") and aura_env.buffs[buff] ~= nil then + aura_env.timeApplied = GetTime() + return true + end + end end \ No newline at end of file diff --git a/NewAge/NullBarrier/CustomDuration1.lua b/NewAge/NullBarrier/CustomDuration1.lua index 8732875..7c61f99 100644 --- a/NewAge/NullBarrier/CustomDuration1.lua +++ b/NewAge/NullBarrier/CustomDuration1.lua @@ -1,3 +1,3 @@ -function() - return aura_env.GetAbsorbs(), aura_env.max, 1 +function() + return aura_env.GetAbsorbs(), aura_env.max, 1 end \ No newline at end of file diff --git a/NewAge/NullBarrier/CustomDuration2.lua b/NewAge/NullBarrier/CustomDuration2.lua index 5d2f12c..ab30a4b 100644 --- a/NewAge/NullBarrier/CustomDuration2.lua +++ b/NewAge/NullBarrier/CustomDuration2.lua @@ -1,3 +1,3 @@ -function() - return 15, aura_env.timeApplied + 15 +function() + return 15, aura_env.timeApplied + 15 end \ No newline at end of file diff --git a/NewAge/NullBarrier/INIT1.lua b/NewAge/NullBarrier/INIT1.lua index 0390795..00fe2a4 100644 --- a/NewAge/NullBarrier/INIT1.lua +++ b/NewAge/NullBarrier/INIT1.lua @@ -1,37 +1,37 @@ -aura_env.buffs = { - ["Null Barrier"] = 1, - ["Empowered Null Barrier"] = 1, -} -aura_env.max = 0 - -aura_env.GetBuff = function(name) - for i = 1, 40 do - if UnitBuff("player", i) == name then - return i - end - end - return 0 -end - -aura_env.GetAbsorb = function(name) - local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) - if temp then return temp else return 0 end -end - -aura_env.GetAbsorbs = function() - local abs = 0 - for k, v in pairs(aura_env.buffs) do - abs = abs + aura_env.GetAbsorb(k) - end - return abs -end - -aura_env.PrettyPrintNum = function(n) - if n > 1e6 then - return string.format("%.2fM", n / 1e6) - elseif n > 1e3 then - return string.format("%.2fk", n / 1e3) - else - return n - end +aura_env.buffs = { + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, +} +aura_env.max = 0 + +aura_env.GetBuff = function(name) + for i = 1, 40 do + if UnitBuff("player", i) == name then + return i + end + end + return 0 +end + +aura_env.GetAbsorb = function(name) + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then return temp else return 0 end +end + +aura_env.GetAbsorbs = function() + local abs = 0 + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) + end + return abs +end + +aura_env.PrettyPrintNum = function(n) + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end end \ No newline at end of file diff --git a/NewAge/NullBarrier/INIT2.lua b/NewAge/NullBarrier/INIT2.lua index 3c074e2..85984f8 100644 --- a/NewAge/NullBarrier/INIT2.lua +++ b/NewAge/NullBarrier/INIT2.lua @@ -1,4 +1,4 @@ -aura_env.buffs = { - ["Null Barrier"] = 1, -} +aura_env.buffs = { + ["Null Barrier"] = 1, +} aura_env.timeApplied = 0 \ No newline at end of file diff --git a/NewAge/NullBarrier/Text1.lua b/NewAge/NullBarrier/Text1.lua index 7459d14..9a93ed4 100644 --- a/NewAge/NullBarrier/Text1.lua +++ b/NewAge/NullBarrier/Text1.lua @@ -1,3 +1,3 @@ -function() - return aura_env.PrettyPrintNum(aura_env.GetAbsorbs()) +function() + return aura_env.PrettyPrintNum(aura_env.GetAbsorbs()) end \ No newline at end of file diff --git a/NewAge/OverallAbsorbs/INIT.lua b/NewAge/OverallAbsorbs/INIT.lua index 2fe5496..21f04ec 100644 --- a/NewAge/OverallAbsorbs/INIT.lua +++ b/NewAge/OverallAbsorbs/INIT.lua @@ -1,41 +1,41 @@ -aura_env.buffs = { - ["Null Barrier"] = 1, - ["Empowered Null Barrier"] = 1, - ["Resounding Protection"] = 1, - ["Guard"] = 1, - ["Void Shroud"] = 1, - ["Stoneskin"] = 1, -} -aura_env.max = 0 - -aura_env.GetBuff = function(name) - for i = 1, 40 do - if UnitBuff("player", i) == name then - return i - end - end - return 0 -end - -aura_env.GetAbsorb = function(name) - local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) - if temp then return temp else return 0 end -end - -aura_env.GetAbsorbs = function() - local abs = 0 - for k, v in pairs(aura_env.buffs) do - abs = abs + aura_env.GetAbsorb(k) - end - return abs -end - -aura_env.PrettyPrintNum = function(n) - if n > 1e6 then - return string.format("%.2fM", n / 1e6) - elseif n > 1e3 then - return string.format("%.2fk", n / 1e3) - else - return n - end +aura_env.buffs = { + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, + ["Resounding Protection"] = 1, + ["Guard"] = 1, + ["Void Shroud"] = 1, + ["Stoneskin"] = 1, +} +aura_env.max = 0 + +aura_env.GetBuff = function(name) + for i = 1, 40 do + if UnitBuff("player", i) == name then + return i + end + end + return 0 +end + +aura_env.GetAbsorb = function(name) + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then return temp else return 0 end +end + +aura_env.GetAbsorbs = function() + local abs = 0 + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) + end + return abs +end + +aura_env.PrettyPrintNum = function(n) + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end end \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/CLEU.lua b/NewAge/PrimaryStatBar/CLEU.lua index d3a2230..398a605 100644 --- a/NewAge/PrimaryStatBar/CLEU.lua +++ b/NewAge/PrimaryStatBar/CLEU.lua @@ -1,7 +1,7 @@ -function(e, ...) - aura_env.currentStat = aura_env.GetPrimaryStat() - if aura_env.maxStat < aura_env.currentStat then - aura_env.maxStat = aura_env.currentStat - end - return true +function(e, ...) + aura_env.currentStat = aura_env.GetPrimaryStat() + if aura_env.maxStat < aura_env.currentStat then + aura_env.maxStat = aura_env.currentStat + end + return true end \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/CustomDuration.lua b/NewAge/PrimaryStatBar/CustomDuration.lua index 0f7d858..314bbce 100644 --- a/NewAge/PrimaryStatBar/CustomDuration.lua +++ b/NewAge/PrimaryStatBar/CustomDuration.lua @@ -1,3 +1,3 @@ -function() - return aura_env.currentStat, aura_env.maxStat, 1 +function() + return aura_env.currentStat, aura_env.maxStat, 1 end \ No newline at end of file diff --git a/NewAge/PrimaryStatBar/INIT.lua b/NewAge/PrimaryStatBar/INIT.lua index 3a66dbc..80ad0b2 100644 --- a/NewAge/PrimaryStatBar/INIT.lua +++ b/NewAge/PrimaryStatBar/INIT.lua @@ -1,17 +1,17 @@ -aura_env.specStatTable = { - ["Windwalker"] = 2, - ["Brewmaster"] = 2, - ["Mistweaver"] = 4, -} -aura_env.maxStat = 0 -aura_env.currentStat = 0 - -aura_env.GetPrimaryStat = function() - stat = UnitStat("player", aura_env.GetPrimStatID()) - return stat -end - -aura_env.GetPrimStatID = function() - specID, specName = GetSpecializationInfo(GetSpecialization()) - return aura_env.specStatTable[specName] +aura_env.specStatTable = { + ["Windwalker"] = 2, + ["Brewmaster"] = 2, + ["Mistweaver"] = 4, +} +aura_env.maxStat = 0 +aura_env.currentStat = 0 + +aura_env.GetPrimaryStat = function() + stat = UnitStat("player", aura_env.GetPrimStatID()) + return stat +end + +aura_env.GetPrimStatID = function() + specID, specName = GetSpecializationInfo(GetSpecialization()) + return aura_env.specStatTable[specName] end \ No newline at end of file From 7a5d8686949bc10328624c76853c8346189b0544 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 1 May 2025 14:11:51 +0200 Subject: [PATCH 20/27] Implement spectraler sighter --- NewAge/DHRogueSniffer/sniffer.lua | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 NewAge/DHRogueSniffer/sniffer.lua diff --git a/NewAge/DHRogueSniffer/sniffer.lua b/NewAge/DHRogueSniffer/sniffer.lua new file mode 100644 index 0000000..05e6e77 --- /dev/null +++ b/NewAge/DHRogueSniffer/sniffer.lua @@ -0,0 +1,43 @@ +-- PLAYER_TARGET_CHANGED +function(e) + local hasEyes = UnitBuff("player", "Spectral Sight") -- Spectral Sight + if not hasEyes then + --print("Player has no Spectral Sight") + return + end + + local unitUuid = UnitGUID("target") + if not unitUuid then + --print(string.format("Target has no UUID: %s", tostring(unitUuid))) + return + end + --print(string.format("Target UUID: %s", tostring(unitUuid))) + + if not string.find(unitUuid, "Player") then + --print(string.format("Target %s is not a player", tostring(unitUuid))) + return + end + + local targetStealth = UnitBuff("target", "Stealth") + if not targetStealth then + --print("Target has no Stealth") + return + end + --print(string.format("Target Stealth: %s", tostring(targetStealth))) + + local targetName = UnitName("target") + if not targetName then + --print("Target has no name") + return + end + --print(string.format("Target Name: %s", tostring(targetName))) + + local pvp = UnitIsPVP("target") + local pvpState = pvp == true and "ON" or "OFF" + + local low, high = WeakAuras.GetRange("target") + + local message = string.format("I see %s in stealth with pvp %s between %d and %d yards away", targetName, pvpState, low, high) + --print(string.format("Sending message: %s", tostring(message))) + SendChatMessage(message, "RAID") +end From be8344289704dc861181263a490a23cf094e4287 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 4 May 2025 18:18:35 +0200 Subject: [PATCH 21/27] Fix up spectraler sighter to not spam --- NewAge/DHRogueSniffer/sniffer.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/NewAge/DHRogueSniffer/sniffer.lua b/NewAge/DHRogueSniffer/sniffer.lua index 05e6e77..7402cec 100644 --- a/NewAge/DHRogueSniffer/sniffer.lua +++ b/NewAge/DHRogueSniffer/sniffer.lua @@ -32,12 +32,22 @@ function(e) end --print(string.format("Target Name: %s", tostring(targetName))) - local pvp = UnitIsPVP("target") + local pvp = UnitIsPVP("target") local pvpState = pvp == true and "ON" or "OFF" local low, high = WeakAuras.GetRange("target") + local key = string.format("%s-%s-%s-%s", unitUuid, targetName, low, high) + --print(string.format("Key: %s", tostring(key))) + --print(string.format("Previous Key: %s", tostring(aura_env.previousTarget))) + if not aura_env.previousTarget then aura_env.previousTarget = key end + if aura_env.previousTarget == key then + --print(string.format("Target same as previous target: %s", tostring(key))) + return + end - local message = string.format("I see %s in stealth with pvp %s between %d and %d yards away", targetName, pvpState, low, high) + local message = + string.format("I see %s in stealth with pvp %s between %d and %d yards away", targetName, pvpState, low, high) --print(string.format("Sending message: %s", tostring(message))) SendChatMessage(message, "RAID") + aura_env.previousTarget = key end From 0f3fe4f7eec13c42b8983cb786cd8c49a65ba1a7 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 May 2025 17:48:16 +0200 Subject: [PATCH 22/27] Add damage intake from wago --- NewAge/DamageIntake/init.lua | 175 ++++++++++++++++++++++++++++++++ NewAge/DamageIntake/trigger.lua | 41 ++++++++ NewAge/DamageIntake/vars.lua | 14 +++ 3 files changed, 230 insertions(+) create mode 100644 NewAge/DamageIntake/init.lua create mode 100644 NewAge/DamageIntake/trigger.lua create mode 100644 NewAge/DamageIntake/vars.lua diff --git a/NewAge/DamageIntake/init.lua b/NewAge/DamageIntake/init.lua new file mode 100644 index 0000000..82562ab --- /dev/null +++ b/NewAge/DamageIntake/init.lua @@ -0,0 +1,175 @@ +--- initial +aura_env.fn = {} +aura_env.damageHistory = {} +aura_env.historyCurrent = {} +aura_env.playerGUID = UnitGUID("player") +aura_env.lastCleanup = 0 +aura_env.historyWindow = 5 +aura_env.cleanupInterval = 1 +aura_env.types = { + SWING = "SWING_DAMAGE", + SPELL = "SPELL_DAMAGE", + RANGE = "RANGE_DAMAGE", + DOT = "SPELL_PERIODIC_DAMAGE", + ENV = "ENVIRONMENTAL_DAMAGE", + BLEED = "BLEED", +} +aura_env.labels = {} +aura_env.labels[aura_env.types.SWING] = "Swing" +aura_env.labels[aura_env.types.SPELL] = "Spell" +aura_env.labels[aura_env.types.RANGE] = "Ranged" +aura_env.labels[aura_env.types.DOT] = "Magic DoT" +aura_env.labels[aura_env.types.ENV] = "Environment" +aura_env.labels[aura_env.types.BLEED] = "Bleed" +aura_env.spellSchool = { + PHYSICAL = 1, +} +aura_env.iconz = {} +aura_env.iconz[aura_env.types.SWING] = 589068 +aura_env.iconz[aura_env.types.SPELL] = 1391677 +aura_env.iconz[aura_env.types.RANGE] = 135128 +aura_env.iconz[aura_env.types.DOT] = 132095 +aura_env.iconz[aura_env.types.ENV] = 237583 +aura_env.iconz[aura_env.types.BLEED] = 1033474 + +-- +-- Returns players current max health +-- +aura_env.fn.getMaxHealth = function() return UnitHealthMax("player") end + +aura_env.fn.isEnabled = function(damageType) + local enabled = damageType == aura_env.types.SWING and aura_env.config.enableSwing + or damageType == aura_env.types.SPELL and aura_env.config.enableSpell + or damageType == aura_env.types.DOT and aura_env.config.enableDot + or damageType == aura_env.types.ENV and aura_env.config.enableEnv + or damageType == aura_env.types.BLEED and aura_env.config.enableBleed + return enabled +end + +-- +-- Checks if the given CLU event is tracked by this aura +-- @return bool +-- +aura_env.fn.isTrackedEvent = function(damageType) + local match = false + for key, typeName in pairs(aura_env.types) do + if damageType == typeName and aura_env.fn.isEnabled(damageType) then match = true end + end + + return match +end + +-- +-- Calculates the amount of damage taken from a given CLU parameter set +-- @return number +-- +aura_env.fn.parseDamage = function(type, ...) + local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing + + if type == aura_env.types.SWING then + -- REGULAR SWINGS + amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = select(12, ...) + elseif + type == aura_env.types.SPELL + or type == aura_env.types.RANGE + or type == aura_env.types.DOT + or type == aura_env.types.BLEED + or type == aura_env.types.ENV + then + amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = select(15, ...) + end + + return amount +end + +-- +-- Returns the summarized, historical damage intake over all sources +-- @return number +-- +aura_env.fn.getCurrentHistoryDamage = function() + local d = 0 + for damageType, value in pairs(aura_env.historyCurrent) do + d = d + value + end + + return d +end + +-- +-- Records a new damage event and notifies the engine. +-- @return void +-- +aura_env.fn.addDamageRecord = function(allStates, time, damageType, damage) + if not damage or damage == 0 then return end + + if not aura_env.historyCurrent[damageType] then aura_env.historyCurrent[damageType] = 0 end + + -- add new damage to current value immediately + aura_env.historyCurrent[damageType] = aura_env.historyCurrent[damageType] + damage + + -- add new history record so the history engine picks it up + table.insert(aura_env.damageHistory, { time = time, damageType = damageType, value = damage }) + + -- invoke state update + aura_env.fn.updateAllState(allStates) +end + +-- +-- Updates the state table of the clone with the new damage. +-- @return boolean +-- +aura_env.fn.updateAllState = function(allStates) + local maxHealth = aura_env.fn.getMaxHealth() + + -- create progress bar records + for idx, value in pairs(aura_env.historyCurrent) do + allStates[idx] = { + changed = true, + show = value ~= 0, + name = aura_env.labels[idx], + progressType = "static", + value = value, + total = maxHealth, + type = idx, + icon = aura_env.iconz[idx], + duration = 3, + autohide = true, + } + end + + return true +end + +-- @return table {SWING_DAMAGE = 123, SPELL_DAMAGE = 0} +aura_env.fn.calcCurrentHistoricalDamage = function() + local currentDamage = {} + local now = GetTime() + + -- iterate over historical damage records + for idx, obj in pairs(aura_env.damageHistory) do + if now - obj.time > aura_env.historyWindow then + aura_env.damageHistory[idx] = nil + else + -- if no value, start with 0 + if not currentDamage[obj.damageType] then currentDamage[obj.damageType] = 0 end + currentDamage[obj.damageType] = currentDamage[obj.damageType] + tonumber(obj.value) + end + end + + -- update current historical value + for key, typeName in pairs(aura_env.types) do + aura_env.historyCurrent[typeName] = currentDamage[typeName] or 0 + end +end + +-- +-- Generates synthetic damage events for a proper display when options are open. +-- @return void +-- +aura_env.fn.createDummyDisplay = function(allStates) + for key, typeName in pairs(aura_env.types) do + if aura_env.fn.isEnabled(typeName) then + aura_env.fn.addDamageRecord(allStates, GetTime(), typeName, math.random(aura_env.fn.getMaxHealth())) + end + end +end diff --git a/NewAge/DamageIntake/trigger.lua b/NewAge/DamageIntake/trigger.lua new file mode 100644 index 0000000..bfd2b79 --- /dev/null +++ b/NewAge/DamageIntake/trigger.lua @@ -0,0 +1,41 @@ +-- COMBAT_LOG_EVENT_UNFILTERED, FRAME_UPDATE +function (allStates, ev, ...) + local now = GetTime() + + if (WeakAuras.IsOptionsOpen()) then + aura_env.fn.createDummyDisplay(allStates) + return true + end + + if (ev == "COMBAT_LOG_EVENT_UNFILTERED") then + ----------------------------------------- + -- COMBAT LOG + ----------------------------------------- + local timestamp, damageType, _, _, _, _, _, destGUID, _, _, _, _, _, spellSchool = ... + + -- hack to separate bleeds from magical DoT + if (damageType == "SPELL_PERIODIC_DAMAGE" and spellSchool == aura_env.spellSchool.PHYSICAL) then + damageType = aura_env.types.BLEED + end + + -- exit early if target is NOT the player or the damageType is NOT relevant + if (destGUID ~= aura_env.playerGUID or not aura_env.fn.isTrackedEvent(damageType)) then + return + end + + -- get damage of current "hit" + local damage = aura_env.fn.parseDamage(damageType, ...) + -- record new damage application + aura_env.fn.addDamageRecord(allStates, now, damageType, damage) + else + ----------------------------------------- + -- FRAME UPDATE + ----------------------------------------- + if (now - aura_env.lastCleanup > aura_env.cleanupInterval) then + aura_env.lastCleanup = now + aura_env.fn.calcCurrentHistoricalDamage() + aura_env.fn.updateAllState(allStates) + end + end + return true +end \ No newline at end of file diff --git a/NewAge/DamageIntake/vars.lua b/NewAge/DamageIntake/vars.lua new file mode 100644 index 0000000..a3f55da --- /dev/null +++ b/NewAge/DamageIntake/vars.lua @@ -0,0 +1,14 @@ +{ + type = { + display = "Damage Type", + type = "select", + values = { + ["SWING_DAMAGE"] = "Auto Attack", + ["SPELL_DAMAGE"] = "Spell Hit", + ["RANGE_DAMAGE"] = "Range Attack", + ["SPELL_PERIODIC_DAMAGE"] = "Spell Damage Over Time", + ["ENVIRONMENTAL_DAMAGE"] = "Environmental", + ["BLEED"] = "Bleed", + } + } +} \ No newline at end of file From c8653783ce733f2333231b3cdd7f42be5803f365 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 May 2025 17:52:34 +0200 Subject: [PATCH 23/27] Fuck with shit a bit --- NewAge/DamageIntake/init.lua | 16 +++++++++++++++- NewAge/DamageIntake/vars.lua | 3 ++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/NewAge/DamageIntake/init.lua b/NewAge/DamageIntake/init.lua index 82562ab..1bd288a 100644 --- a/NewAge/DamageIntake/init.lua +++ b/NewAge/DamageIntake/init.lua @@ -4,7 +4,7 @@ aura_env.damageHistory = {} aura_env.historyCurrent = {} aura_env.playerGUID = UnitGUID("player") aura_env.lastCleanup = 0 -aura_env.historyWindow = 5 +aura_env.historyWindow = 10 aura_env.cleanupInterval = 1 aura_env.types = { SWING = "SWING_DAMAGE", @@ -114,6 +114,18 @@ aura_env.fn.addDamageRecord = function(allStates, time, damageType, damage) aura_env.fn.updateAllState(allStates) end +local function normalize(value) + if value > 1e9 then + return string.format("%.2fB", value / 1e9) + elseif value > 1e6 then + return string.format("%.2fM", value / 1e6) + elseif value > 1e3 then + return string.format("%.2fk", value / 1e3) + else + return value + end +end + -- -- Updates the state table of the clone with the new damage. -- @return boolean @@ -129,12 +141,14 @@ aura_env.fn.updateAllState = function(allStates) name = aura_env.labels[idx], progressType = "static", value = value, + display = normalize(value), total = maxHealth, type = idx, icon = aura_env.iconz[idx], duration = 3, autohide = true, } + print(allStates[idx].display) end return true diff --git a/NewAge/DamageIntake/vars.lua b/NewAge/DamageIntake/vars.lua index a3f55da..359e9d0 100644 --- a/NewAge/DamageIntake/vars.lua +++ b/NewAge/DamageIntake/vars.lua @@ -10,5 +10,6 @@ ["ENVIRONMENTAL_DAMAGE"] = "Environmental", ["BLEED"] = "Bleed", } - } + }, + display = "string" } \ No newline at end of file From 1d5284bd81449a8e461b1547a5881959130bb0c6 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 May 2025 18:07:06 +0200 Subject: [PATCH 24/27] Add damage intake Cool ass weakaura, like combat log but right there, cool!! --- NewAge/DamageIntake/export | 1 + 1 file changed, 1 insertion(+) create mode 100644 NewAge/DamageIntake/export diff --git a/NewAge/DamageIntake/export b/NewAge/DamageIntake/export new file mode 100644 index 0000000..b5c0d98 --- /dev/null +++ b/NewAge/DamageIntake/export @@ -0,0 +1 @@ +!LVtAZTnYY9Frv9QsQwzAEtPuXBcPiTfDKOuiOwV7ZVLKGadjNNab4IdjrVX83E6UNzagCWdlTj5dz1AjG5SN(UB0Z4kJhn2iySr1svAwQ2yJvJnSX)hA1036gM7IWLJhuRz5XgZ88Tz(DmTE023B9yJoo8V9ntF7Tth555eYHME2CHx)UWQ85n3252V8hWSmJcx65F36qUNBaSSHJnw47fTUVLN74bnR3OAvyBnDTGrDVh3f6)QEdg1BOAdVYZXZhM4GkJhuE8GQ0VRr)Uo2imbFVNnwBAXWxnI8DgBSmmCDW)Y7FpcqL4EVpgGE)LWMzPagJGqt)qbuXD5YNMdpgSKEgEl0NVybZpqacJIBaF0MnlA(8rBwZgBCDVBU)JpCd0p9QzKVzvydwZCC6Blp5brZypXCdnGzXFzSXKRABmAIXO2dhL059(mQtJ77DdSCriCzS2XCdSNg0iGnJz6aegdxZvSafKg5MaAHIMS8CIw5MGCa8lZ3105xGdehjaniKpFLjIs0XiYJHRNl8BMzado3kUb4GdNoCgteJkGbut4qsdCuYebiyLj39VWLlM28x0cclPPdFHBcxNnlWASrxEaIYd2o1C70zM(BNgAoZHTDk3D7ulVvZmd3o1HheYDxGncnrpzBUYCbmSzBGzaB02PNg8m0Z5qtomMn8xILa(ll06SsecNOzadTXtkYYLe7Wq2IePMaMZCPasN7gn6UBrMlIUct0XZK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4M(AhtJ5j07VQ4sn()( \ No newline at end of file From ac4de9a0ab50261b8e18cdd0250d744aa34820b9 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 May 2025 19:35:43 +0200 Subject: [PATCH 25/27] Code format --- NewAge/AHBot/INIT.lua | 22 +- NewAge/Automation/INIT.lua | 742 ++++++++++++++++---------------- NewAge/CataAuraBar/INIT.lua | 512 +++++++++++----------- NewAge/CataAuraBar/INIT_BFA.lua | 525 +++++++++++----------- NewAge/DamageIntake/init.lua | 4 +- NewAge/NullBarrier/INIT1.lua | 48 ++- NewAge/NullBarrier/INIT2.lua | 4 +- NewAge/OverallAbsorbs/INIT.lua | 56 +-- NewAge/PrimaryStatBar/INIT.lua | 16 +- 9 files changed, 960 insertions(+), 969 deletions(-) diff --git a/NewAge/AHBot/INIT.lua b/NewAge/AHBot/INIT.lua index e86393b..bdd5d98 100644 --- a/NewAge/AHBot/INIT.lua +++ b/NewAge/AHBot/INIT.lua @@ -1,17 +1,17 @@ aura_env.throttleTime = 10 aura_env.sellPriceThresholds = { - [168446] = 5000 * 100 * 100; -- Accord of Critical Strike - [168447] = 5000 * 100 * 100; -- Accord of Haste - [168448] = 5000 * 100 * 100; -- Accord of Mastery - [168449] = 5000 * 100 * 100; -- Accord of Versatility - [168592] = 4500 * 100 * 100; -- Oceanic Restoration - [168496] = 4500 * 100 * 100; -- Force Multiplier - [168593] = 4500 * 100 * 100; -- Machinist's Brilliance - [168598] = 4500 * 100 * 100; -- Naga Hide + [168446] = 5000 * 100 * 100, -- Accord of Critical Strike + [168447] = 5000 * 100 * 100, -- Accord of Haste + [168448] = 5000 * 100 * 100, -- Accord of Mastery + [168449] = 5000 * 100 * 100, -- Accord of Versatility + [168592] = 4500 * 100 * 100, -- Oceanic Restoration + [168496] = 4500 * 100 * 100, -- Force Multiplier + [168593] = 4500 * 100 * 100, -- Machinist's Brilliance + [168598] = 4500 * 100 * 100, -- Naga Hide } aura_env.buyPriceThresholds = { - [152576] = 5 * 100 * 100; -- Tidesrpay Linen - [152877] = 500 * 100 * 100; -- Veiled Crystal -} \ No newline at end of file + [152576] = 5 * 100 * 100, -- Tidesrpay Linen + [152877] = 500 * 100 * 100, -- Veiled Crystal +} diff --git a/NewAge/Automation/INIT.lua b/NewAge/Automation/INIT.lua index 5e67227..bdec97a 100644 --- a/NewAge/Automation/INIT.lua +++ b/NewAge/Automation/INIT.lua @@ -1,26 +1,26 @@ aura_env.debug = true aura_env.filter = { - [1] = true, --Gold - [2] = true, --Azerite - [3] = true, --War resources - [4] = true, --Residuum - [5] = true, --Manapearls - [6] = true, --Mounts - [7] = true, --High ilvl - [8] = false, --Herbs - [9] = true, --Cooking - [10] = true, --Cloth - [11] = false, --Metal & Stone - [12] = true, --Gold filter greys - [13] = true, -- >1 && <4 quality items, no gear - [14] = true, --Quest items - [15] = true, --All greys - [16] = true, --Whitelist - [17] = true, --Quest items (different filter) - [18] = true, --Class aproperiate >2 items - [19] = true, --Jewelery >2 quality - [20] = true, --Additional mount filter - [21] = true, --Tradeskill // Elemental + [1] = true, --Gold + [2] = true, --Azerite + [3] = true, --War resources + [4] = true, --Residuum + [5] = true, --Manapearls + [6] = true, --Mounts + [7] = true, --High ilvl + [8] = false, --Herbs + [9] = true, --Cooking + [10] = true, --Cloth + [11] = false, --Metal & Stone + [12] = true, --Gold filter greys + [13] = true, -- >1 && <4 quality items, no gear + [14] = true, --Quest items + [15] = true, --All greys + [16] = true, --Whitelist + [17] = true, --Quest items (different filter) + [18] = true, --Class aproperiate >2 items + [19] = true, --Jewelery >2 quality + [20] = true, --Additional mount filter + [21] = true, --Tradeskill // Elemental } aura_env.ilvlFilter = 200 aura_env.goldFilter = 0.5 @@ -28,353 +28,367 @@ aura_env.goldFilter = aura_env.goldFilter * 10000 aura_env.throttleSell = false aura_env.whitelist = { - ["Pygmy Suckerfish"] = 1, - ["Drakkari Offerings"] = 1, - ["Deepcoral Pod"] = 1, - ["Hardened Spring"] = 1, - ["Machined Gear Assembly"] = 1, - ["Tempered Plating"] = 1, - ["Hefty Glimmershell"] = 1, - ["Fresh Meat"] = 1, - ["Wood"] = 1, - - - ["Gloom Dust"] = 1, - ["Veiled Crytal"] = 1, - ["Coalescing Visions"] = 1, - ["Echoes of Ny'alotha"] = 1, - ["Corrupted Mementos"] = 1, - - ["Blood of Sargeras"] = 1, - ["Primal Sargerite"] = 1, - - ["Chain Ignitercoil"] = 1, - ["Galvanic Oscillator"] = 1, - ["Corrupted Memento"] = 1, + ["Pygmy Suckerfish"] = 1, + ["Drakkari Offerings"] = 1, + ["Deepcoral Pod"] = 1, + ["Hardened Spring"] = 1, + ["Machined Gear Assembly"] = 1, + ["Tempered Plating"] = 1, + ["Hefty Glimmershell"] = 1, + ["Fresh Meat"] = 1, + ["Wood"] = 1, + + ["Gloom Dust"] = 1, + ["Veiled Crytal"] = 1, + ["Coalescing Visions"] = 1, + ["Echoes of Ny'alotha"] = 1, + ["Corrupted Mementos"] = 1, + + ["Blood of Sargeras"] = 1, + ["Primal Sargerite"] = 1, + + ["Chain Ignitercoil"] = 1, + ["Galvanic Oscillator"] = 1, + ["Corrupted Memento"] = 1, } aura_env.sellWhitelist = { - ["Blacksmith Hammer"] = 1, - ["Endless Tincture of Renewed Combat"] = 1, - ["Mr. Munchykins"] = 1, - ["Arclight Spanner"] = 1, - ["Runeblade of Baron Rivendare"] = 1, + ["Blacksmith Hammer"] = 1, + ["Endless Tincture of Renewed Combat"] = 1, + ["Mr. Munchykins"] = 1, + ["Arclight Spanner"] = 1, + ["Runeblade of Baron Rivendare"] = 1, } aura_env.toSell = {} aura_env.getequipID = function(equip) - if equip == "INVTYPE_HEAD" then return 1 - elseif equip == "INVTYPE_NECK" then return 2 - elseif equip == "INVTYPE_SHOULDER" then return 3 - elseif equip == "INVTYPE_BODY" then return 4 - elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then return 5 - elseif equip == "INVTYPE_WAIST" then return 6 - elseif equip == "INVTYPE_LEGS" then return 7 - elseif equip == "INVTYPE_FEET" then return 8 - elseif equip == "INVTYPE_WRIST" then return 9 - elseif equip == "INVTYPE_HAND" then return 10 - 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_SHIELD" then return 17 - else return nil end + if equip == "INVTYPE_HEAD" then + return 1 + elseif equip == "INVTYPE_NECK" then + return 2 + elseif equip == "INVTYPE_SHOULDER" then + return 3 + elseif equip == "INVTYPE_BODY" then + return 4 + elseif equip == "INVTYPE_CHEST" or equip == "INVTYPE_ROBE" then + return 5 + elseif equip == "INVTYPE_WAIST" then + return 6 + elseif equip == "INVTYPE_LEGS" then + return 7 + elseif equip == "INVTYPE_FEET" then + return 8 + elseif equip == "INVTYPE_WRIST" then + return 9 + elseif equip == "INVTYPE_HAND" then + return 10 + 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_SHIELD" then + return 17 + else + return nil + end end aura_env.skills = { - --Warrior - [1] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 1, - ["Guns"] = 1, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 1, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 1, - ["Wands"] = 0, - }, - --Paladin - [2] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 0, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Hunter - [3] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 1, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 1, - ["Guns"] = 1, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 1, - ["Wands"] = 0, - }, - --Rogue - [4] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Priest - [5] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Death Knight - [6] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 1, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 1, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 1, - ["Warglaives"] = 0, - ["Staves"] = 0, - ["Fist Weapons"] = 0, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Shaman - [7] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 0, - ["Mail"] = 1, - ["Plate"] = 0, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Mage - [8] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Warlock - [9] = { - --Armor Skills - ["Cloth"] = 1, - ["Leather"] = 0, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 0, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 1, - }, - --Monk - [10] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 1, - ["Shields"] = 1, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Druid - [11] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 0, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 1, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 1, - ["One-Handed Swords"] = 0, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 0, - ["Staves"] = 1, - ["Fist Weapons"] = 1, - ["Daggers"] = 1, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, - --Demon Hunter - [12] = { - --Armor Skills - ["Cloth"] = 0, - ["Leather"] = 1, - ["Mail"] = 0, - ["Plate"] = 0, - ["Shields"] = 0, - --Weapon Skills - ["One-Handed Axes"] = 1, - ["Two-Handed Axes"] = 0, - ["Bows"] = 0, - ["Guns"] = 0, - ["One-Handed Maces"] = 0, - ["Two-Handed Maces"] = 0, - ["Polearms"] = 0, - ["One-Handed Swords"] = 1, - ["Two-Handed Swords"] = 0, - ["Warglaives"] = 1, - ["Staves"] = 0, - ["Fist Weapons"] = 1, - ["Daggers"] = 0, - ["Crossbows"] = 0, - ["Wands"] = 0, - }, -} \ No newline at end of file + --Warrior + [1] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 1, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Paladin + [2] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Hunter + [3] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 1, + ["Guns"] = 1, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 1, + ["Wands"] = 0, + }, + --Rogue + [4] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Priest + [5] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Death Knight + [6] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 1, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 1, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 1, + ["Warglaives"] = 0, + ["Staves"] = 0, + ["Fist Weapons"] = 0, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Shaman + [7] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 0, + ["Mail"] = 1, + ["Plate"] = 0, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Mage + [8] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Warlock + [9] = { + --Armor Skills + ["Cloth"] = 1, + ["Leather"] = 0, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 0, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 1, + }, + --Monk + [10] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 1, + ["Shields"] = 1, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Druid + [11] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 0, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 1, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 1, + ["One-Handed Swords"] = 0, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 0, + ["Staves"] = 1, + ["Fist Weapons"] = 1, + ["Daggers"] = 1, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, + --Demon Hunter + [12] = { + --Armor Skills + ["Cloth"] = 0, + ["Leather"] = 1, + ["Mail"] = 0, + ["Plate"] = 0, + ["Shields"] = 0, + --Weapon Skills + ["One-Handed Axes"] = 1, + ["Two-Handed Axes"] = 0, + ["Bows"] = 0, + ["Guns"] = 0, + ["One-Handed Maces"] = 0, + ["Two-Handed Maces"] = 0, + ["Polearms"] = 0, + ["One-Handed Swords"] = 1, + ["Two-Handed Swords"] = 0, + ["Warglaives"] = 1, + ["Staves"] = 0, + ["Fist Weapons"] = 1, + ["Daggers"] = 0, + ["Crossbows"] = 0, + ["Wands"] = 0, + }, +} diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index fa28845..64ee205 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -1,308 +1,294 @@ local function StrSplit(inputString, separator) - local outputTable = {} - for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do - outputTable[#outputTable + 1] = str - end - return outputTable + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable end local function PrintTable(table) - for k,v in pairs(table) do - print(k .. " " .. v) - end + for k, v in pairs(table) do + print(k .. " " .. v) + end end aura_env.GetClassColor = function(class) - if class == "Death Knight" then - return "\124cFFC41E3A" - elseif class == "Druid" then - return "\124cFFFF7C0A" - elseif class == "Hunter" then - return "\124cFFAAD372" - elseif class == "Mage" then - return "\124cFF3FC7EB" - elseif class == "Paladin" then - return "\124cFFF48CBA" - elseif class == "Priest" then - return "\124cFFFFFFFF" - elseif class == "Rogue" then - return "\124cFFFFF468" - elseif class == "Shaman" then - return "\124cFF0070DD" - elseif class == "Warlock" then - return "\124cFF8788EE" - elseif class == "Warrior" then - return "\124cFFC69B6D" - end + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end end local Unit = { - New = function(self, unit) - o = { - ["unit"] = unit, - } - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, - GetAuras = function(self, auraFunc, name, type) - return nil - end, + GetAuras = function(self, auraFunc, name, type) return nil end, } -local BasicUnit = Unit:New("player") +local BasicUnit = Unit:New "player" function BasicUnit:GetAuras(auraFunc, name) - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) - if aura ~= nil then - return { - [UnitName(self.unit)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - } - else - return {} - end + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + }, + } + else + return {} + end end -- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New("group") +local GroupUnit = Unit:New "group" function GroupUnit:GetAuras(auraFunc, name) - local raidMem = GetNumRaidMembers() - local num = GetNumPartyMembers() - local unitPrefix = "party" - if raidMem > num then - unitPrefix = "raid" - num = raidMem - end - auras = {} - for i = 1, num do - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - if aura ~= nil then - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - if unitPrefix == "party" then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) - if aura ~= nil then - auras[UnitName("player")] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - return auras + local raidMem = GetNumRaidMembers() + local num = GetNumPartyMembers() + local unitPrefix = "party" + if raidMem > num then + unitPrefix = "raid" + num = raidMem + end + auras = {} + for i = 1, num do + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + if unitPrefix == "party" then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + if aura ~= nil then + auras[UnitName "player"] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + return auras end -- Nameplate does not work, find out why? -local NameplateUnit = Unit:New("nameplate") +local NameplateUnit = Unit:New "nameplate" function NameplateUnit:GetAuras(auraFunc, name) - local unitPrefix = "nameplate" - auras = {} - for i = 1, 40 do - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) - if aura ~= nil then - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - end - end - return auras + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(auraPrefix .. i, name) + if aura ~= nil then + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + end + end + return auras end local UnitFactory = { - New = function(self) - o = {} - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, - CreateUnit = function(self, target) - target = string.lower(target) - if target == "player" or target == "target" or target == "focus" then - return BasicUnit:New(target) - elseif target == "group" then - return GroupUnit:New(target) - elseif target == "nameplate" then - return NameplateUnit:New(target) - end - end, + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, } local unitFactory = UnitFactory:New() local Aura = { - New = function(self, entry, index) - o = { - ["name"] = entry.auraName, - ["unit"] = entry.target, - ["hasCooldown"] = entry.hasCooldown, - ["index"] = index, - ["GetAura"] = entry.GetAura, - } - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self, entry, index) + o = { + ["name"] = entry.auraName, + ["unit"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, + } + setmetatable(o, self) + self.__index = self + return o + end, - IsActive = function(self) - for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do - for k2, v2 in pairs(v) do - end - return true - end - return false - end, - IsOnCooldown = function(self) - if not self.hasCooldown then - return false - end - return GetSpellCooldown(self.name) > 0 - end, + IsActive = function(self) + for k, v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + for k2, v2 in pairs(v) do + end + return true + end + return false + end, + IsOnCooldown = function(self) + if not self.hasCooldown then return false end + return GetSpellCooldown(self.name) > 0 + end, - AddAsAura = function(self, allstates) - local auras = self.unit:GetAuras(self.GetAura, self.name) - for k,v in pairs(auras) do - duration = v.duration - expirationTime = v.expirationTime - icon = self:GetAuraIcon(v.spellID) - allstates[self.name .. k] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = expirationTime, - index = self.index, - icon = icon, - pname = k, - stacks = v.stacks, - pclass = v.class, - IsOnCooldown = true, - IsActive = true, - IsBad = self.GetAura == UnitDebuff, - } - end - end, - AddAsCooldown = function(self, allstates) - if not self.hasCooldown then - return false - end - startTime, duration = GetSpellCooldown(self.name) - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = startTime + duration, - index = self.index, - icon = icon, - IsOnCooldown = true, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - AddAsIcon = function(self, allstates) - if not self.hasCooldown then - return false - end - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "static", - value = 1, - total = 1, - index = self.index, - icon = icon, - IsOnCooldown = false, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, + AddAsAura = function(self, allstates) + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k, v in pairs(auras) do + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + stacks = v.stacks, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end + end, + AddAsCooldown = function(self, allstates) + if not self.hasCooldown then return false end + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + AddAsIcon = function(self, allstates) + if not self.hasCooldown then return false end + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, - GetSpellIcon = function(self) - return select(3, GetSpellInfo(self.name)) - end, - GetAuraIcon = function(self, spellID) - return select(3, GetSpellInfo(spellID)) - end, + GetSpellIcon = function(self) return select(3, GetSpellInfo(self.name)) end, + GetAuraIcon = function(self, spellID) return select(3, GetSpellInfo(spellID)) end, } local Entry = { - New = function(self, entry) - entry = self:TrimWhitespace(entry) + New = function(self, entry) + entry = self:TrimWhitespace(entry) - local entryData = StrSplit(entry, ",") - local name = self:ReadEntryData(entryData, 1) - local type = self:ReadEntryData(entryData, 2) or "Buff" - local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") - local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false - cooldown = not cooldown - local GetAura = UnitBuff - - if type == "Debuff" then GetAura = UnitDebuff end + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff - o = { - ["entry"] = entry, - ["auraName"] = name, - ["GetAura"] = GetAura, - ["target"] = target, - ["hasCooldown"] = cooldown, - } - setmetatable(o, self) - self.__index = self - return o - end, + if type == "Debuff" then GetAura = UnitDebuff end - ReadEntryData = function(self, entryData, index) - local str = entryData[index] - if str == nil then - return nil - end - str = self:TrimWhitespace(str) - return str - end, + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, - TrimWhitespace = function(self, str) - str = str:gsub("^[ ]+", "") - str = str:gsub("\n$", "") - str = str:gsub("[ ]+$", "") - return str - end, + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then return nil end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, } aura_env.auras = {} 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) - aura_env.auras[#aura_env.auras + 1] = auraObj + auraObj = Aura:New(entry, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj end aura_env.HandleEvent = function(allstates) - for k, v in ipairs(aura_env.auras) do - if v:IsActive() then - v:AddAsAura(allstates) - elseif v:IsOnCooldown() and not v:IsActive() then - v:AddAsCooldown(allstates) - elseif not v:IsOnCooldown() and not v:IsActive() then - v:AddAsIcon(allstates) - end - end -end \ No newline at end of file + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end +end diff --git a/NewAge/CataAuraBar/INIT_BFA.lua b/NewAge/CataAuraBar/INIT_BFA.lua index 0157b4c..9a54def 100644 --- a/NewAge/CataAuraBar/INIT_BFA.lua +++ b/NewAge/CataAuraBar/INIT_BFA.lua @@ -1,317 +1,304 @@ local function StrSplit(inputString, separator) - local outputTable = {} - for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do - outputTable[#outputTable + 1] = str - end - return outputTable + local outputTable = {} + for str in string.gmatch(inputString, "([^" .. separator .. "]+)") do + outputTable[#outputTable + 1] = str + end + return outputTable end local function PrintTable(table) - for k,v in pairs(table) do - print(k .. " " .. v) - end + for k, v in pairs(table) do + print(k .. " " .. v) + end end local function GetAuraIndex(func, unit, name) - for i = 1, 40 do - local aura = func(unit, i) - if aura == "name" then return i end - if aura == nil then return 0 end - end - return 0 + for i = 1, 40 do + local aura = func(unit, i) + if aura == "name" then return i end + if aura == nil then return 0 end + end + return 0 end aura_env.GetClassColor = function(class) - if class == "Death Knight" then - return "\124cFFC41E3A" - elseif class == "Druid" then - return "\124cFFFF7C0A" - elseif class == "Hunter" then - return "\124cFFAAD372" - elseif class == "Mage" then - return "\124cFF3FC7EB" - elseif class == "Paladin" then - return "\124cFFF48CBA" - elseif class == "Priest" then - return "\124cFFFFFFFF" - elseif class == "Rogue" then - return "\124cFFFFF468" - elseif class == "Shaman" then - return "\124cFF0070DD" - elseif class == "Warlock" then - return "\124cFF8788EE" - elseif class == "Warrior" then - return "\124cFFC69B6D" - end + if class == "Death Knight" then + return "\124cFFC41E3A" + elseif class == "Druid" then + return "\124cFFFF7C0A" + elseif class == "Hunter" then + return "\124cFFAAD372" + elseif class == "Mage" then + return "\124cFF3FC7EB" + elseif class == "Paladin" then + return "\124cFFF48CBA" + elseif class == "Priest" then + return "\124cFFFFFFFF" + elseif class == "Rogue" then + return "\124cFFFFF468" + elseif class == "Shaman" then + return "\124cFF0070DD" + elseif class == "Warlock" then + return "\124cFF8788EE" + elseif class == "Warrior" then + return "\124cFFC69B6D" + end end local Unit = { - New = function(self, unit) - o = { - ["unit"] = unit, - } - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self, unit) + o = { + ["unit"] = unit, + } + setmetatable(o, self) + self.__index = self + return o + end, - GetAuras = function(self, auraFunc, name, type) - return nil - end, + GetAuras = function(self, auraFunc, name, type) return nil end, } -local BasicUnit = Unit:New("player") +local BasicUnit = Unit:New "player" function BasicUnit:GetAuras(auraFunc, name) - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) - if aura ~= nil then - return { - [UnitName(self.unit)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - } - else - return {} - end + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) + if aura ~= nil then + return { + [UnitName(self.unit)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + }, + } + else + return {} + end end -- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New("group") +local GroupUnit = Unit:New "group" function GroupUnit:GetAuras(auraFunc, name) - local num = GetNumGroupMembers() - local unitPrefix = "party" - if IsInRaid() then - unitPrefix = "raid" - end - auras = {} - for i = 1, num do - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) - if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, auraIndex) - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - if unitPrefix == "party" then - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) - local auraIndex = GetAuraIndex(auraFunc, "player", name)if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) - auras[UnitName("player")] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["class"] = UnitClass(unitPrefix .. i) or "Paladin", - ["stacks"] = stacks or 1, - } - end - end - return auras + local num = GetNumGroupMembers() + local unitPrefix = "party" + if IsInRaid() then unitPrefix = "raid" end + auras = {} + for i = 1, num do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) + if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = + auraFunc(unitPrefix .. i, auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + if unitPrefix == "party" then + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) + local auraIndex = GetAuraIndex(auraFunc, "player", name) + if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName "player"] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["class"] = UnitClass(unitPrefix .. i) or "Paladin", + ["stacks"] = stacks or 1, + } + end + end + return auras end -- Nameplate does not work, find out why? -local NameplateUnit = Unit:New("nameplate") +local NameplateUnit = Unit:New "nameplate" function NameplateUnit:GetAuras(auraFunc, name) - local unitPrefix = "nameplate" - auras = {} - for i = 1, 40 do - -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) - local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name)if auraIndex > 0 then - local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) - auras[UnitName(unitPrefix .. i)] = { - ["duration"] = duration, - ["expirationTime"] = expirationTime, - ["spellID"] = spellID, - ["stacks"] = stacks or 1, - } - end - end - return auras + local unitPrefix = "nameplate" + auras = {} + for i = 1, 40 do + -- local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(unitPrefix .. i, name) + local auraIndex = GetAuraIndex(auraFunc, unitPrefix .. i, name) + if auraIndex > 0 then + local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) + auras[UnitName(unitPrefix .. i)] = { + ["duration"] = duration, + ["expirationTime"] = expirationTime, + ["spellID"] = spellID, + ["stacks"] = stacks or 1, + } + end + end + return auras end local UnitFactory = { - New = function(self) - o = {} - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self) + o = {} + setmetatable(o, self) + self.__index = self + return o + end, - CreateUnit = function(self, target) - target = string.lower(target) - if target == "player" or target == "target" or target == "focus" then - return BasicUnit:New(target) - elseif target == "group" then - return GroupUnit:New(target) - elseif target == "nameplate" then - return NameplateUnit:New(target) - end - end, + CreateUnit = function(self, target) + target = string.lower(target) + if target == "player" or target == "target" or target == "focus" then + return BasicUnit:New(target) + elseif target == "group" then + return GroupUnit:New(target) + elseif target == "nameplate" then + return NameplateUnit:New(target) + end + end, } local unitFactory = UnitFactory:New() local Aura = { - New = function(self, entry, index) - o = { - ["name"] = entry.auraName, - ["unit"] = entry.target, - ["hasCooldown"] = entry.hasCooldown, - ["index"] = index, - ["GetAura"] = entry.GetAura, - } - setmetatable(o, self) - self.__index = self - return o - end, + New = function(self, entry, index) + o = { + ["name"] = entry.auraName, + ["unit"] = entry.target, + ["hasCooldown"] = entry.hasCooldown, + ["index"] = index, + ["GetAura"] = entry.GetAura, + } + setmetatable(o, self) + self.__index = self + return o + end, - IsActive = function(self) - for k,v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do - return true - end - return false - end, - IsOnCooldown = function(self) - if not self.hasCooldown then - return false - end - return GetSpellCooldown(self.name) > 0 - end, + IsActive = function(self) + for k, v in pairs(self.unit:GetAuras(self.GetAura, self.name)) do + return true + end + return false + end, + IsOnCooldown = function(self) + if not self.hasCooldown then return false end + return GetSpellCooldown(self.name) > 0 + end, - AddAsAura = function(self, allstates) - local auras = self.unit:GetAuras(self.GetAura, self.name) - for k,v in pairs(auras) do - duration = v.duration - expirationTime = v.expirationTime - icon = self:GetAuraIcon(v.spellID) - allstates[self.name .. k] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = expirationTime, - index = self.index, - icon = icon, - pname = k, - stacks = v.stacks, - pclass = v.class, - IsOnCooldown = true, - IsActive = true, - IsBad = self.GetAura == UnitDebuff, - } - end - end, - AddAsCooldown = function(self, allstates) - if not self.hasCooldown then - return false - end - startTime, duration = GetSpellCooldown(self.name) - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "timed", - duration = duration, - expirationTime = startTime + duration, - index = self.index, - icon = icon, - IsOnCooldown = true, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, - AddAsIcon = function(self, allstates) - if not self.hasCooldown then - return false - end - icon = self:GetSpellIcon() - allstates[self.name] = { - changed = true, - show = true, - resort = true, - progressType = "static", - value = 1, - total = 1, - index = self.index, - icon = icon, - IsOnCooldown = false, - IsActive = false, - IsBad = self.GetAura == UnitDebuff, - } - end, + AddAsAura = function(self, allstates) + local auras = self.unit:GetAuras(self.GetAura, self.name) + for k, v in pairs(auras) do + duration = v.duration + expirationTime = v.expirationTime + icon = self:GetAuraIcon(v.spellID) + allstates[self.name .. k] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = expirationTime, + index = self.index, + icon = icon, + pname = k, + stacks = v.stacks, + pclass = v.class, + IsOnCooldown = true, + IsActive = true, + IsBad = self.GetAura == UnitDebuff, + } + end + end, + AddAsCooldown = function(self, allstates) + if not self.hasCooldown then return false end + startTime, duration = GetSpellCooldown(self.name) + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "timed", + duration = duration, + expirationTime = startTime + duration, + index = self.index, + icon = icon, + IsOnCooldown = true, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, + AddAsIcon = function(self, allstates) + if not self.hasCooldown then return false end + icon = self:GetSpellIcon() + allstates[self.name] = { + changed = true, + show = true, + resort = true, + progressType = "static", + value = 1, + total = 1, + index = self.index, + icon = icon, + IsOnCooldown = false, + IsActive = false, + IsBad = self.GetAura == UnitDebuff, + } + end, - GetSpellIcon = function(self) - return select(3, GetSpellInfo(self.name)) - end, - GetAuraIcon = function(self, spellID) - return select(3, GetSpellInfo(spellID)) - end, + GetSpellIcon = function(self) return select(3, GetSpellInfo(self.name)) end, + GetAuraIcon = function(self, spellID) return select(3, GetSpellInfo(spellID)) end, } local Entry = { - New = function(self, entry) - entry = self:TrimWhitespace(entry) + New = function(self, entry) + entry = self:TrimWhitespace(entry) - local entryData = StrSplit(entry, ",") - local name = self:ReadEntryData(entryData, 1) - local type = self:ReadEntryData(entryData, 2) or "Buff" - local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") - local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false - cooldown = not cooldown - local GetAura = UnitBuff - - if type == "Debuff" then GetAura = UnitDebuff end + local entryData = StrSplit(entry, ",") + local name = self:ReadEntryData(entryData, 1) + local type = self:ReadEntryData(entryData, 2) or "Buff" + local target = unitFactory:CreateUnit(self:ReadEntryData(entryData, 3) or "Player") + local cooldown = (self:ReadEntryData(entryData, 4) == "0") or false + cooldown = not cooldown + local GetAura = UnitBuff - o = { - ["entry"] = entry, - ["auraName"] = name, - ["GetAura"] = GetAura, - ["target"] = target, - ["hasCooldown"] = cooldown, - } - setmetatable(o, self) - self.__index = self - return o - end, + if type == "Debuff" then GetAura = UnitDebuff end - ReadEntryData = function(self, entryData, index) - local str = entryData[index] - if str == nil then - return nil - end - str = self:TrimWhitespace(str) - return str - end, + o = { + ["entry"] = entry, + ["auraName"] = name, + ["GetAura"] = GetAura, + ["target"] = target, + ["hasCooldown"] = cooldown, + } + setmetatable(o, self) + self.__index = self + return o + end, - TrimWhitespace = function(self, str) - str = str:gsub("^[ ]+", "") - str = str:gsub("\n$", "") - str = str:gsub("[ ]+$", "") - return str - end, + ReadEntryData = function(self, entryData, index) + local str = entryData[index] + if str == nil then return nil end + str = self:TrimWhitespace(str) + return str + end, + + TrimWhitespace = function(self, str) + str = str:gsub("^[ ]+", "") + str = str:gsub("\n$", "") + str = str:gsub("[ ]+$", "") + return str + end, } aura_env.auras = {} 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) - aura_env.auras[#aura_env.auras + 1] = auraObj + auraObj = Aura:New(entry, #aura_env.auras + 1) + aura_env.auras[#aura_env.auras + 1] = auraObj end aura_env.HandleEvent = function(allstates) - for k, v in ipairs(aura_env.auras) do - if v:IsActive() then - v:AddAsAura(allstates) - elseif v:IsOnCooldown() and not v:IsActive() then - v:AddAsCooldown(allstates) - elseif not v:IsOnCooldown() and not v:IsActive() then - v:AddAsIcon(allstates) - end - end -end \ No newline at end of file + for k, v in ipairs(aura_env.auras) do + if v:IsActive() then + v:AddAsAura(allstates) + elseif v:IsOnCooldown() and not v:IsActive() then + v:AddAsCooldown(allstates) + elseif not v:IsOnCooldown() and not v:IsActive() then + v:AddAsIcon(allstates) + end + end +end diff --git a/NewAge/DamageIntake/init.lua b/NewAge/DamageIntake/init.lua index 1bd288a..ba6a616 100644 --- a/NewAge/DamageIntake/init.lua +++ b/NewAge/DamageIntake/init.lua @@ -2,7 +2,7 @@ aura_env.fn = {} aura_env.damageHistory = {} aura_env.historyCurrent = {} -aura_env.playerGUID = UnitGUID("player") +aura_env.playerGUID = UnitGUID "player" aura_env.lastCleanup = 0 aura_env.historyWindow = 10 aura_env.cleanupInterval = 1 @@ -35,7 +35,7 @@ aura_env.iconz[aura_env.types.BLEED] = 1033474 -- -- Returns players current max health -- -aura_env.fn.getMaxHealth = function() return UnitHealthMax("player") end +aura_env.fn.getMaxHealth = function() return UnitHealthMax "player" end aura_env.fn.isEnabled = function(damageType) local enabled = damageType == aura_env.types.SWING and aura_env.config.enableSwing diff --git a/NewAge/NullBarrier/INIT1.lua b/NewAge/NullBarrier/INIT1.lua index 00fe2a4..3b75aa1 100644 --- a/NewAge/NullBarrier/INIT1.lua +++ b/NewAge/NullBarrier/INIT1.lua @@ -1,37 +1,39 @@ aura_env.buffs = { - ["Null Barrier"] = 1, - ["Empowered Null Barrier"] = 1, + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, } aura_env.max = 0 aura_env.GetBuff = function(name) - for i = 1, 40 do - if UnitBuff("player", i) == name then - return i - end - end - return 0 + for i = 1, 40 do + if UnitBuff("player", i) == name then return i end + end + return 0 end aura_env.GetAbsorb = function(name) - local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) - if temp then return temp else return 0 end + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then + return temp + else + return 0 + end end aura_env.GetAbsorbs = function() - local abs = 0 - for k, v in pairs(aura_env.buffs) do - abs = abs + aura_env.GetAbsorb(k) - end - return abs + local abs = 0 + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) + end + return abs end aura_env.PrettyPrintNum = function(n) - if n > 1e6 then - return string.format("%.2fM", n / 1e6) - elseif n > 1e3 then - return string.format("%.2fk", n / 1e3) - else - return n - end -end \ No newline at end of file + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end +end diff --git a/NewAge/NullBarrier/INIT2.lua b/NewAge/NullBarrier/INIT2.lua index 85984f8..da3aac6 100644 --- a/NewAge/NullBarrier/INIT2.lua +++ b/NewAge/NullBarrier/INIT2.lua @@ -1,4 +1,4 @@ aura_env.buffs = { - ["Null Barrier"] = 1, + ["Null Barrier"] = 1, } -aura_env.timeApplied = 0 \ No newline at end of file +aura_env.timeApplied = 0 diff --git a/NewAge/OverallAbsorbs/INIT.lua b/NewAge/OverallAbsorbs/INIT.lua index 21f04ec..233dfed 100644 --- a/NewAge/OverallAbsorbs/INIT.lua +++ b/NewAge/OverallAbsorbs/INIT.lua @@ -1,41 +1,43 @@ aura_env.buffs = { - ["Null Barrier"] = 1, - ["Empowered Null Barrier"] = 1, - ["Resounding Protection"] = 1, - ["Guard"] = 1, - ["Void Shroud"] = 1, - ["Stoneskin"] = 1, + ["Null Barrier"] = 1, + ["Empowered Null Barrier"] = 1, + ["Resounding Protection"] = 1, + ["Guard"] = 1, + ["Void Shroud"] = 1, + ["Stoneskin"] = 1, } aura_env.max = 0 aura_env.GetBuff = function(name) - for i = 1, 40 do - if UnitBuff("player", i) == name then - return i - end - end - return 0 + for i = 1, 40 do + if UnitBuff("player", i) == name then return i end + end + return 0 end aura_env.GetAbsorb = function(name) - local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) - if temp then return temp else return 0 end + local temp = select(16, UnitBuff("player", aura_env.GetBuff(name))) + if temp then + return temp + else + return 0 + end end aura_env.GetAbsorbs = function() - local abs = 0 - for k, v in pairs(aura_env.buffs) do - abs = abs + aura_env.GetAbsorb(k) - end - return abs + local abs = 0 + for k, v in pairs(aura_env.buffs) do + abs = abs + aura_env.GetAbsorb(k) + end + return abs end aura_env.PrettyPrintNum = function(n) - if n > 1e6 then - return string.format("%.2fM", n / 1e6) - elseif n > 1e3 then - return string.format("%.2fk", n / 1e3) - else - return n - end -end \ No newline at end of file + if n > 1e6 then + return string.format("%.2fM", n / 1e6) + elseif n > 1e3 then + return string.format("%.2fk", n / 1e3) + else + return n + end +end diff --git a/NewAge/PrimaryStatBar/INIT.lua b/NewAge/PrimaryStatBar/INIT.lua index 80ad0b2..64e9e7d 100644 --- a/NewAge/PrimaryStatBar/INIT.lua +++ b/NewAge/PrimaryStatBar/INIT.lua @@ -1,17 +1,17 @@ aura_env.specStatTable = { - ["Windwalker"] = 2, - ["Brewmaster"] = 2, - ["Mistweaver"] = 4, + ["Windwalker"] = 2, + ["Brewmaster"] = 2, + ["Mistweaver"] = 4, } aura_env.maxStat = 0 aura_env.currentStat = 0 aura_env.GetPrimaryStat = function() - stat = UnitStat("player", aura_env.GetPrimStatID()) - return stat + stat = UnitStat("player", aura_env.GetPrimStatID()) + return stat end aura_env.GetPrimStatID = function() - specID, specName = GetSpecializationInfo(GetSpecialization()) - return aura_env.specStatTable[specName] -end \ No newline at end of file + specID, specName = GetSpecializationInfo(GetSpecialization()) + return aura_env.specStatTable[specName] +end From 9962841a01ec0a25e6589a480b8a501bafeff07f Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 15 May 2025 20:36:53 +0200 Subject: [PATCH 26/27] Update --- NewAge/CataAuraBar/INIT.lua | 8 ++++---- NewAge/CataAuraBar/INIT_BFA.lua | 8 ++++---- NewAge/DamageIntake/init.lua | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NewAge/CataAuraBar/INIT.lua b/NewAge/CataAuraBar/INIT.lua index 64ee205..10f84c6 100644 --- a/NewAge/CataAuraBar/INIT.lua +++ b/NewAge/CataAuraBar/INIT.lua @@ -48,7 +48,7 @@ local Unit = { GetAuras = function(self, auraFunc, name, type) return nil end, } -local BasicUnit = Unit:New "player" +local BasicUnit = Unit:New("player") function BasicUnit:GetAuras(auraFunc, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) if aura ~= nil then @@ -65,7 +65,7 @@ function BasicUnit:GetAuras(auraFunc, name) end end -- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New "group" +local GroupUnit = Unit:New("group") function GroupUnit:GetAuras(auraFunc, name) local raidMem = GetNumRaidMembers() local num = GetNumPartyMembers() @@ -90,7 +90,7 @@ function GroupUnit:GetAuras(auraFunc, name) if unitPrefix == "party" then local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", name) if aura ~= nil then - auras[UnitName "player"] = { + auras[UnitName("player")] = { ["duration"] = duration, ["expirationTime"] = expirationTime, ["spellID"] = spellID, @@ -102,7 +102,7 @@ function GroupUnit:GetAuras(auraFunc, name) return auras end -- Nameplate does not work, find out why? -local NameplateUnit = Unit:New "nameplate" +local NameplateUnit = Unit:New("nameplate") function NameplateUnit:GetAuras(auraFunc, name) local unitPrefix = "nameplate" auras = {} diff --git a/NewAge/CataAuraBar/INIT_BFA.lua b/NewAge/CataAuraBar/INIT_BFA.lua index 9a54def..787dfcc 100644 --- a/NewAge/CataAuraBar/INIT_BFA.lua +++ b/NewAge/CataAuraBar/INIT_BFA.lua @@ -57,7 +57,7 @@ local Unit = { GetAuras = function(self, auraFunc, name, type) return nil end, } -local BasicUnit = Unit:New "player" +local BasicUnit = Unit:New("player") function BasicUnit:GetAuras(auraFunc, name) local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc(self.unit, name) if aura ~= nil then @@ -74,7 +74,7 @@ function BasicUnit:GetAuras(auraFunc, name) end end -- Maybe implement some sort of throttle to group unit? -local GroupUnit = Unit:New "group" +local GroupUnit = Unit:New("group") function GroupUnit:GetAuras(auraFunc, name) local num = GetNumGroupMembers() local unitPrefix = "party" @@ -100,7 +100,7 @@ function GroupUnit:GetAuras(auraFunc, name) local auraIndex = GetAuraIndex(auraFunc, "player", name) if auraIndex > 0 then local aura, _, _, stacks, _, duration, expirationTime, _, _, _, spellID = auraFunc("player", auraIndex) - auras[UnitName "player"] = { + auras[UnitName("player")] = { ["duration"] = duration, ["expirationTime"] = expirationTime, ["spellID"] = spellID, @@ -112,7 +112,7 @@ function GroupUnit:GetAuras(auraFunc, name) return auras end -- Nameplate does not work, find out why? -local NameplateUnit = Unit:New "nameplate" +local NameplateUnit = Unit:New("nameplate") function NameplateUnit:GetAuras(auraFunc, name) local unitPrefix = "nameplate" auras = {} diff --git a/NewAge/DamageIntake/init.lua b/NewAge/DamageIntake/init.lua index ba6a616..1bd288a 100644 --- a/NewAge/DamageIntake/init.lua +++ b/NewAge/DamageIntake/init.lua @@ -2,7 +2,7 @@ aura_env.fn = {} aura_env.damageHistory = {} aura_env.historyCurrent = {} -aura_env.playerGUID = UnitGUID "player" +aura_env.playerGUID = UnitGUID("player") aura_env.lastCleanup = 0 aura_env.historyWindow = 10 aura_env.cleanupInterval = 1 @@ -35,7 +35,7 @@ aura_env.iconz[aura_env.types.BLEED] = 1033474 -- -- Returns players current max health -- -aura_env.fn.getMaxHealth = function() return UnitHealthMax "player" end +aura_env.fn.getMaxHealth = function() return UnitHealthMax("player") end aura_env.fn.isEnabled = function(damageType) local enabled = damageType == aura_env.types.SWING and aura_env.config.enableSwing From d79e9844d7a95c72f40e1008e829f8cf537b2b01 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 16 May 2025 10:02:52 +0200 Subject: [PATCH 27/27] Update --- NewAge/DamageIntake/export | 2 +- NewAge/DamageIntake/init.lua | 15 ++++++++++++--- NewAge/NameplateInfo/Hostility.lua | 19 +++++++++++++++++++ NewAge/ScrollingText/export | 1 + 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 NewAge/NameplateInfo/Hostility.lua create mode 100644 NewAge/ScrollingText/export diff --git a/NewAge/DamageIntake/export b/NewAge/DamageIntake/export index b5c0d98..f6f9cfa 100644 --- a/NewAge/DamageIntake/export +++ b/NewAge/DamageIntake/export @@ -1 +1 @@ -!LVtAZTnYY9Frv9QsQwzAEtPuXBcPiTfDKOuiOwV7ZVLKGadjNNab4IdjrVX83E6UNzag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AW6NR5Ek)N29U4K9DxOxuJ3o2xtj7GshkcFtj2xTvgwXUr)w7l6tvU49J3T0eURFQeVBUhyAO2Bk4QGQDDDx55fU8ozZ2q1LlLLEWi8S0xAAz(muvfihA6xxEQkjb0j4jIwi(oeRLPBN0PT1jDw5Dsx5Go65F2j2)0N52quqG0(n3n63vVt6DULmCKiFuDWzZ99HqLCmDFOK798388wHe36N96UW1IRB9iJ7FzADjAGeSS3)Bv9soRA8161YHVghknNl2NclHybvph6cPZp)Cp))ZO)S(67by6ZXCMfvR5Z3oS)F)wu9hCOjscKUI5gfCDRPvFKIyr1sFUPf7FCHj9)Rk0X0)FCF)pK8BFWG2IKe2gmmV6iYn()o \ No newline at end of file diff --git a/NewAge/DamageIntake/init.lua b/NewAge/DamageIntake/init.lua index 1bd288a..75e126d 100644 --- a/NewAge/DamageIntake/init.lua +++ b/NewAge/DamageIntake/init.lua @@ -37,6 +37,14 @@ aura_env.iconz[aura_env.types.BLEED] = 1033474 -- aura_env.fn.getMaxHealth = function() return UnitHealthMax("player") end +aura_env.fn.getMaxHit = function() + local maxHit = 0 + for _, amount in pairs(aura_env.historyCurrent) do + maxHit = maxHit + amount + end + return maxHit +end + aura_env.fn.isEnabled = function(damageType) local enabled = damageType == aura_env.types.SWING and aura_env.config.enableSwing or damageType == aura_env.types.SPELL and aura_env.config.enableSpell @@ -131,7 +139,8 @@ end -- @return boolean -- aura_env.fn.updateAllState = function(allStates) - local maxHealth = aura_env.fn.getMaxHealth() + -- local maxHealth = aura_env.fn.getMaxHealth() + local maxHit = aura_env.fn.getMaxHit() -- create progress bar records for idx, value in pairs(aura_env.historyCurrent) do @@ -142,13 +151,13 @@ aura_env.fn.updateAllState = function(allStates) progressType = "static", value = value, display = normalize(value), - total = maxHealth, + total = maxHit, type = idx, icon = aura_env.iconz[idx], duration = 3, autohide = true, } - print(allStates[idx].display) + --print(allStates[idx].display) end return true diff --git a/NewAge/NameplateInfo/Hostility.lua b/NewAge/NameplateInfo/Hostility.lua new file mode 100644 index 0000000..72ee785 --- /dev/null +++ b/NewAge/NameplateInfo/Hostility.lua @@ -0,0 +1,19 @@ +--- NAME_PLATE_UNIT_ADDED NAME_PLATE_UNIT_REMOVED +function(allstates, e, ...) + ---@cast allstates allstates + print("Starting to process nameplates for hostility...") + for i = 1, 40 do + local unit = "nameplate" .. i + local hostile = UnitCanAttack("player", unit) + allstates[unit] = { + show = true, + changed = true, + resort = true, + + hostile = hostile, + } + print("Processed nameplate " .. i .. " hostility: " .. tostring(hostile)) + end + print("Finished processing nameplates for hostility.") + return true +end diff --git a/NewAge/ScrollingText/export b/NewAge/ScrollingText/export new file mode 100644 index 0000000..cb8c847 --- /dev/null +++ b/NewAge/ScrollingText/export @@ -0,0 +1 @@ +!T3ZdtjoYY)DHQSo5DiBs4pcB92xvOIR4PGpdU77(T1IgibipdjujbDDpp)S)R75pzscjqa195Ex07ytM0tpD3tp90DpDWbYd6pqD2avD8)GlDUZW1s7bp46UY0pW)tzqxPbDRq(Sk2Ip8R636nESNH)GUnLKgO(a)U9KRuBGQM9OPoUx4yAdqEy7U9BF5avV5AU3EPJVMVPJnIn1fUwduN67p379V7D3RnXPSPZ7moD0rlU6F77(UkduhQn62jUolS1p0XYXLruslrusLRHeL5ih7Rhfcsk5ltGuoG8vx4z03XXY3C(GdgOEVJR(ND1Mpq9ZbxnuZnHrSCnf5A1Buxz)Q1KA2iMurv3WtZFHRMVXGHduh7GC)XUMF)PB(3l00H21E6M(9zscQe73jcclhnYmG3CJrKjLfaTbxqK0UowgKhAApbUsTFRU)Mae6ThqbDKLMN3siWZ87gXBKkeAP)Fx45BOBOFUPnsZUgtGjN(pmhghnGtaXqGEXilQ4Y34BatcaCUHLL5t3CeWmmEQp)rO4rUjIdFhsFCgbiXJmXVVufuLrZA(unuWPUWe0aFqA8P7V4t326tq3hB(nd9pBQ7pfK7iWol8TmTHN07Q(N1PBByccMQmCpa0p0DDGjSdSm)(31C1bjmBMvndkcJa23zgs2WGUWEeQAUBXNo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