#Playing a sound when Tooltip value reaches calculation.

43 messages · Page 1 of 1 (latest)

brave echo
#

I want to play a sound when Scarlet adaptation reaches 100% charge.

From reading other WAs I can see that the text percentage is updated like so:

function()
    if aura_env.state and aura_env.state.tooltip1 then
        local toolt = aura_env.state.tooltip1
        local max = ""..GetSpellBonusDamage(7)*2.254
        
        return  (toolt/max *100),max,true
    else
        return 0
    end
end

But I'm not sure I understand how to use this in the context of a trigger to play a sound.

merry sonnet
#

Do you need it to be a trigger?

#

You could just make a custom condition for that and let that play the sound

merry sonnet
#

like, just a

  if s[1].expirationTime and s[1].tooltip1 then
    return s[1].tooltip1 == GetSpellBonusDamage(7)*2.254
  end
end```
#

as a custom check, and then play a sound

brave echo
#

I'll give this a shot when I get home

brave echo
#

I guess I'm not sure how to reference the actual buff "sacrelet adaptation".

I haven't played since the beginning of BFA so I'm a little rusty and trying to relearn all this.

Steps I took were --> create a new Icon Aura ---> go to condition tab ---> if "custom check" ---> paste the code.

How do I make sure its referencing the right buff tooltip.

#

I don't know that I've ever actually worked with just conditions before

merry sonnet
#

well you'd need to add a trigger for that buff

#

the default trigger of a new aura should already be set to aura -> player -> buff

#

enter scarlet adaptation in "name(s)" and click "fetch tooltip info"

#

then go to conditions, make a custom check condition like that above and do your stuff

brave echo
#

doesn't appear to work

merry sonnet
#

export your aura to wago please and link it here

brave echo
#

Here is the WA i was studying to figure out how to track SA

This is where I found the calculation for the SA percentage.

https://wago.io/XKOU4nK2W

Simple weak aura that displays your Scarlet Adaptation amount, and the percentage of your max. The percentage is color c

merry sonnet
#

no, give me the one you tried to make please

brave echo
#

its in the first link

#

Scar ad

merry sonnet
#

he uses GetSpellBonusDamage(7)*1.61 as max

#

why did you write 2.254 initially?

#

change your custom check to this:

    if s[1] and s[1].tooltip1 then
        return s[1].tooltip1 >= GetSpellBonusDamage(7)*1.61
    end
end```
and try again
brave echo
#

did he? I feel like I copied it directly

merry sonnet
#

ye, in the first aura you linked there every instance of max is *1.61

brave echo
#

maybe its been updated from a change

#

well now I'm even more confused haha

#

becasue now its working

#

but on my installed its using the 2.254

merry sonnet
#

nope, even the very first version from September 20th 2022, 7:59 pm uses 1.61

brave echo
#

and the numbers are looking right in the display

#

welp that number did the trick anyway. I plan on taking a deeper dive this go around and learning LUA to make WAs from scratch and do more with custom functions. Do you know of any "start here" resources I should be aware of?

#

and thanks so much for the help

merry sonnet
#

the best "start here" resource for making custom WAs is:
know when to NOT use custom code 😄

#

a lot of Weakauras using code don't need to. in 99.9% of cases, using the default tools performs better than code

#

and if you use the inbuilt stuff, then you don't have to worry about maintaining things. the WA devs do that in the background for you

#

meanwhile each patch there are doooozens of people here with WAs that broke because something about the API changed which fucked their custom code. when they actually could've just used the inbuilt things all along

#

but if there's a case where you have to use some custom code, there's this

#

!starterkit

cosmic aspenBOT
merry sonnet
#

and nice to see that it works now 🙂

brave echo
#

oh awesome. Yeah I've only ever worked with the default tools and never really used custom code unless I have to do some kind of calculation like we just did. I assume the above was a case where custom code was neccessary