Thread Tools Display Modes
12-07-23, 12:54 PM   #1
Erdshockegon
A Defias Bandit
Join Date: Dec 2023
Posts: 3
Wotlk classic WeakAura ShamanFriend Total Windfury dmg to guild chat

Hi guys,
maybe someone of you knows the WA Shaman friend. The only part that is interesting to me is the total amount of Windfury Damage. This workes just fine, when a windfury procs, the total amount is displayed. Now I want to send this total amount via chat message into the guild chat.

I've figured out how the get the "MH" damage value and can post it via chat. (Only using a 2H weapon)
Unfortunately it seems that it only counts the first two hits (the inital white hit and the first WF hit) but not the 3rd (second WF hit)
So the aura posts i.e. 1500 , chat posts only 1000. The battle logs show first hit 300, sec, 700 , thrid 500.
Also if there is a total amount of 2 hits (2 normal hits, 1hit 1 crit, 2crits,) then it posts the 2 hits via chat and not one. So it seems that 2 hit WFs work, but with three hits, one is missing

function()
local mhState = aura_env.saved_states["MH"]
if mhState then
local totalMHDamage = mhState.damage
return string.format("Total Main-Hand Damage: %d", totalMHDamage)
end
end

This is what I added as a custom function under WA > Shamanfirend > Windfury total > Actions > Chat Message > %c > custom function.

I know this is very specific, but maybe someone has some knowledge about this?
On wago.io/ShamanFriend you can get this WA.
Thanks in advance for any kind of help

Last edited by Erdshockegon : 12-08-23 at 02:18 AM. Reason: Added additional Info
  Reply With Quote
12-07-23, 02:38 PM   #2
Erdshockegon
A Defias Bandit
Join Date: Dec 2023
Posts: 3
Update: With the help of ChatGPT I've created this update:

function(allstates, event, _, subevent, _, sourceGUID, _, _, _, _, _, _, _, arg1, arg2, arg3, arg4, arg5, arg6, arg7, _, _, arg10, _, arg12, arg13)
local c = aura_env.config
-- Existing code...

-- Initialize total damage and hit/crit counters
local totalMHDamage = 0
local totalMHHits = 0
local totalMHCrits = 0

-- At the end of the function
for hand, saved_state in pairs(aura_env.saved_states) do
if hand == "MH" then
totalMHDamage = totalMHDamage + saved_state.damage
totalMHHits = totalMHHits + saved_state.hits
totalMHCrits = totalMHCrits + saved_state.crits
end
end

-- Additional logic for Windfury hits
local windfuryHits = aura_env.saved_states["Windfury"]
if windfuryHits then
totalMHDamage = totalMHDamage + windfuryHits.damage
totalMHHits = totalMHHits + windfuryHits.hits
totalMHCrits = totalMHCrits + windfuryHits.crits
end

-- Build and return a string
local resultString = "Total MH Damage: " .. totalMHDamage .. " (Hits: " .. totalMHHits .. ", Crits: " .. totalMHCrits .. ")"
return resultString
end

It is a bit fancier, becaus it also lists the Hits and crits.
But still it misses one hit of the total hit count. But I dont see how to get this, because we get the damage amout out of saved_state.damage where the combiend damage should be?



It also seems to not reset the WF hit count if two WFs proc one after another, so it can happen that hits are 4 and crit 1.
When this happens the chat output is also one hit behind.
So it seems that there must be a counting issue somewhere i guess.

Last edited by Erdshockegon : 12-07-23 at 03:12 PM. Reason: Added Image and additional Info
  Reply With Quote
12-10-23, 05:32 AM   #3
Mimma
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Nov 2019
Posts: 7
Originally Posted by Erdshockegon View Post
Now I want to send this total amount via chat message into the guild chat.
My first question: WHY?

The only one who cares about your damage is yourself. I can safely tell that every guild member will hate you after the 3rd post of that kind. It is a bad idea and it should die.

if you want to post in a channel, then create your own (/join MyTestChannel) and maybe invite a few friends there if you are having some competition there or whatever.
  Reply With Quote
12-10-23, 08:53 AM   #4
Erdshockegon
A Defias Bandit
Join Date: Dec 2023
Posts: 3
Thanks!
The guild chat was just for convenience. I have a guild with only two other friends alone, so no one gets bothered. If I can fix the output, I can change it to what ever channel I like.
But my question was more on regarding the whole missing hit thing
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Wotlk classic WeakAura ShamanFriend Total Windfury dmg to guild chat


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off