WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Wotlk classic WeakAura ShamanFriend Total Windfury dmg to guild chat (https://www.wowinterface.com/forums/showthread.php?t=59728)

Erdshockegon 12-07-23 12:54 PM

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? :D
On wago.io/ShamanFriend you can get this WA.
Thanks in advance for any kind of help

Erdshockegon 12-07-23 02:38 PM

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.

Mimma 12-10-23 05:32 AM

Quote:

Originally Posted by Erdshockegon (Post 342987)
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.

Erdshockegon 12-10-23 08:53 AM

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 :)


All times are GMT -6. The time now is 09:20 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI