AdiButtonAuras

AdiButtonAuras

404k Downloads

Help with custom code

mspykerez opened this issue ยท 3 comments

commented

So I'm not very good at it but I made this to make Starsurge icon on the action bar to show the current number of Arcanic Pulsar stacks that I have on my char:

return Configure {
    'Custom Arcanic Pulsar',
    'Shows the stacks of @NAME',
    78674, -- Starsurge (show the rule on this spell)
    'player', -- the event unit (where to look for the buff)
    'UNIT_AURA', -- the event for refreshing the rule
    function(_, model) -- code to be executed when the event fires
        local found, count = GetPlayerBuff('player', 287790) -- Arcanic Pulsar
        if found then
            model.count = count
        end
    end,
}

So far so good, works fine, but now how to I make it show the number of stacks AND at the same time it flashes highlights when it reaches 8 stacks ?

Another thing that I can't make it work is how do I make a spell flash highlight when it is out of cooldown? Like for example Celestial Alignment ? We have the option to show missing but NOT to show missing WHEN only the cooldown ends. Can you please paste here the custom code for it ?

I would also like to know if it is possible to add 'Moonkin Form' to flash highlight when its missing since you cannot edit/select said icon on the configure options. Another spell that is not present on the addon is druid talent 'Warrior of Elune' and 'Force of Nature'.

commented
return Configure {
    'Custom Arcanic Pulsar',
    'Shows the stacks of @NAME',
    78674, -- Starsurge (show the rule on this spell)
    'player', -- the event unit (where to look for the buff)
    'UNIT_AURA', -- the event for refreshing the rule
    function(_, model) -- code to be executed when the event fires
        local found, count = GetPlayerBuff('player', 287790) -- Arcanic Pulsar
        if found then
            model.count = count
            model.flash = count > 7
        end
    end,
}

The option to turn off flashes on spells which are on cooldown is called "No flash on cooldown". It is the first option on the main settings screen. It does not affect Blizzard flashes.

commented

Thx for the code, works fine!

Regarding the option on the main settings screen 'No flash on cooldown' and 'No flash out of combat' wouldn't it be better to make this options per spell/item and not universal since we might want it to only apply on certain spells and not others... I would also like to suggest the implementation of a slide with a timer that we can set for the 'No flash on cooldown' so an ability flashes not when it reaches 0 on the cooldown but like 5s before reaching 0.

commented

Given my time schedule, I can't make a promise on any of those.