WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Need help with code of WA (https://www.wowinterface.com/forums/showthread.php?t=58980)

Clayent 11-17-21 04:49 AM

Need help with code of WA
 
Hi. Please need help with correcting oа this weakaura - https://wago.io/jN4pinl25
I want to add there a feature that will remove dead players from it's list. There are next strings in code:
Code:

-- Maintain player list
if event == "GROUP_ROSTER_UPDATE" then
   
-- Remove
for _, state in pairs(s) do
    local unitName = state.name
    if not UnitInParty(unitName) then
        state.show = false
        state.changed = true
    end
end

What I tried? I added CLEU:UNIT_DIED in events in WA's settings and changed code to:
Code:

-- Maintain player list
if event == "GROUP_ROSTER_UPDATE"
or (subEvent == "UNIT_DIED") then
   
-- Remove
for _, state in pairs(s) do
    local unitName = state.name
    if not UnitInParty(unitName) then
        state.show = false
        state.changed = true
    end
    if UnitIsDead(unitName) then
        state.show = false
        state.changed = true
    end
end

This works but not as wanted. Then I removed more code, leaving only strings for dead players:
Code:

-- Maintain player list
if event == "GROUP_ROSTER_UPDATE"
or (subEvent == "UNIT_DIED") then
   
-- Remove
for _, state in pairs(s) do
    local unitName = state.name
    if UnitIsDead(unitName) then
        state.show = false
        --state.changed = true
    end
end

Again it works not as wanted. I've got a prompt that I need use a UNIT_HEALTH event, but here I stopped, because don't know what to to.

Can anyone please change a code of this weakaura to dead players not shown?

Clayent 11-19-21 04:49 AM

Can anyone please help?

Clayent 11-25-21 04:31 AM

Can anyone please help?

myrroddin 11-25-21 05:55 AM

There's no need to bump posts. If someone can answer, they will. In GROUP_ROSTER_UPDATE, you want one or the other of these:


All times are GMT -6. The time now is 12:25 AM.

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