Page 61 of 111 FirstFirst ... 1151596061626371 ... LastLast
Results 601 to 610 of 1109

Thread: WeakAuras Tutoring Thread

  1. #601

    Default

    Quote Originally Posted by Kulldam View Post
    Alright I think I see what you're asking for, and this is the modified versions I came up with:

    RIDICULOUSNESS WITH A SIDE OF GENIUS

    Hope that helps you out, lemme know if you have any questions.
    Dude, you're amazing lol. You went way beyond what I even was hoping you might come up with and it's perfect. This guy is the man!

    edit: One thing after playing with it.. I love the different bar colors red/yellow/green etc and I'd like for it to only show the percentage. So in display, I checked the "timer" box to show the numerical percentage in the right hand part of the bars. But the problem is, it only shows the number of the percentage. Hate to nitpick but how do I get a "%" after the number? Looking through the coding is a bit beyond me but is there anything I can change real quick to display the number%?
    Last edited by Ulchi; 09-06-2014 at 08:24 PM.

  2. #602

    Default

    Quote Originally Posted by Ulchi View Post
    Dude, you're amazing lol. You went way beyond what I even was hoping you might come up with and it's perfect. This guy is the man!

    edit: One thing after playing with it.. I love the different bar colors red/yellow/green etc and I'd like for it to only show the percentage. So in display, I checked the "timer" box to show the numerical percentage in the right hand part of the bars. But the problem is, it only shows the number of the percentage. Hate to nitpick but how do I get a "%" after the number? Looking through the coding is a bit beyond me but is there anything I can change real quick to display the number%?
    Ah yes, I've run into that issue before myself.

    It turns out it's caused by WeakAuras escaping characters prior to display, and since the escape character in Lua is the % sign, it can be tricky to get that to show up. Normally for Lua you get a % sign to show by escaping it with itself, or writing %%. But in WeakAuras that doesn't work because of it's own escaping code that is running behind the scenes.

    Long story short, to add it to your output text, you need to "double-escape" the output string in your Trigger > Name Info function at the bottom.

    Change:

    Code:
    return ShortenNumber(GetValue(PercentMax)*100, nil, '%d%%')


    to this:

    Code:
    return ShortenNumber(GetValue(PercentMax)*100, nil, '%d%%%%')


    Notice the quadruple % at the end. The first escaped percentage sign (%%) will be cancelled by WeakAuras, but then the second one will properly display your desired %.

    It's strange behavior but it has something to do with WeakAuras using it's own custom % escapes in those fields I believe (such as %s or %n).

    Hope that helps, enjoy!

  3. #603

    Default

    Yep that did the trick!! /bow

  4. #604

    Default

    Hi Kulldam,

    I was wondering if you could help me set up an aura for the resto-druid "Wild Mushroom: Bloom" Spell (ID=102791)
    I would like it to trigger (become visible) when the mushroom is fully charged, the combat log event is (SPELL_ACTIVATION_OVERLAY_GLOW_SHOW)
    and be hidden with the trigger (SPELL_ACTIVATION_OVERLAY_GLOW_HIDE)
    Any help you can give will be greatly appreciated
    Thanks in advance

  5. #605

    Default

    Quote Originally Posted by Albathien View Post
    Hi Kulldam,

    I was wondering if you could help me set up an aura for the resto-druid "Wild Mushroom: Bloom" Spell (ID=102791)
    I would like it to trigger (become visible) when the mushroom is fully charged, the combat log event is (SPELL_ACTIVATION_OVERLAY_GLOW_SHOW)
    and be hidden with the trigger (SPELL_ACTIVATION_OVERLAY_GLOW_HIDE)
    Any help you can give will be greatly appreciated
    Thanks in advance
    That's quite an easy one in fact. This skeleton Display has the functionality you want; I'll leave it to you to fill in the details as you see fit:

    Druid - Wild Mushroom: Bloom Full


    Enjoy!

  6. #606

    Default

    Quote Originally Posted by Kulldam View Post
    That's quite an easy one in fact. This skeleton Display has the functionality you want; I'll leave it to you to fill in the details as you see fit:

    Druid - Wild Mushroom: Bloom Full


    Enjoy!
    Hi Kulldam,

    Thank you for the quick response, this is exactly what I'm looking for, and am embarrassed by it's simplicity.
    However, it is triggering off the resto 2-piece HT ability Sage Mender when that reaches 5-stacks (even though this doesn't actually have an icon or glow :/)
    I understand that I have to expand on the If-Then statement to get the trigger to check for the SpellID too (102791) and have been looking unsuccessfully for an example of this so I can work out the syntax - I've gotten to page 32 so far, and been unable to find what I'm looking for. I will keep looking, but if anyone can give me a quick-link to an example, or syntax resource, that would be greatly appreciated.

    Thanks again for the help, and thankyou for the massive effort you have put in for the WA community!

  7. #607

    Default

    Ok sorted it out
    function(event, arg1)
    if event == 'SPELL_ACTIVATION_OVERLAY_GLOW_SHOW' and arg1== 102791 then
    return true
    end
    end
    dy0VeaqjuO6tsfgfjvDkHeZckXTKs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jLqeYXfIcrHOq85nalGN6ofDF23cCvWLd(oVX3ZiR qCmC5of9naPrGGdMVnM63NgB2yZYGU9zbywyzWj0YaGVHhCrMa 71O453AOqWGsBO1JrDn61Om1HV2bCsWodtHShjGfMWN3oDlVFM SZBUeuPDNA(apVXGgcIgwrPHvMrULqaL69t(1rof9POpv3trFk Spf9PgCk6NpV5U1n6SJoW3uDk6b0SF(d
    Thanks again for your help

  8. #608

    Default

    Quote Originally Posted by Albathien View Post
    Ok sorted it out

    Thanks again for your help
    Awesome, glad you figured it out! =)

  9. #609

    Default

    Wow dude, I'm surprised that you're still here doing stuff for 3+ years on the same thread. I've recently decided to start making some custom Auras in preparation of WoD, but a lot of random code I find to try to learn just leaves me trying to find out more bits and pieces that I don't know. I'll ask here when I need help, but is there somewhere I can reference to learn more? Is it a matter of just knowing LUA? or is there a weak aura reference guide somewhere?

    I have basic programming skills, but LUA is just a new language to me and there are some small things that I don't understand.

    1) Next my actual questions. When I was scouring the net I found this thread: http://www.wowace.com/addons/project...-progress-bar/

    Basically could you tell me what this portion of the code is used for?

    Code:
    function(_, _, message, _, _, source, _, destGUID, dest, _, _, spellName)
    All the other code I've seen uses that space empty in front of function(). What is this space used for?

    2) Are variables I make in a custom trigger local to all parts of that specific aura? (such as custom untrigger / duration info / display, etc...)
    3) Is there a way to make multiple instances of an aura based on specific units? Example: I have boss1 that I want to track energy of. but during he spawns a boss2 and boss3 that I also want to see the enrgy of for the same purpose / triggers of that aura. I understand how I can get the name of the bosses and label them, I just don't know how to make the extra instances without just making a whole new aura for each specific boss.


    Feel free to direct/link me anywhere that can answer these questions. Its really great to have a centralized place that's meant for Weak auras itself instead of scouring the internet for LUA information.
    Last edited by Krazyito; 09-10-2014 at 01:07 AM.

  10. #610

    Default

    Great questions Krazy and nice to meet someone who wants to learn more!

    Quote Originally Posted by Krazyito View Post
    Wow dude, I'm surprised that you're still here doing stuff for 3+ years on the same thread. I've recently decided to start making some custom Auras in preparation of WoD, but a lot of random code I find to try to learn just leaves me trying to find out more bits and pieces that I don't know. I'll ask here when I need help, but is there somewhere I can reference to learn more? Is it a matter of just knowing LUA? or is there a weak aura reference guide somewhere?
    Most of the help I provide here seems to focus on custom Lua code, so definitely the primary resource for learning would just be basic Lua knowledge. This book is a good starting point for someone with basic programming knowledge. Beyond that, for WeakAura specifics, it's mostly just lots of use along with trial and error. By and large, the custom code answers I provide only use WeakAuras as a "shell", and are equivalent of small addons that are using very useful and already existent WeakAuras display options and visuals to process what is shown. Unfortunately there isn't a WeakAuras reference per se, but the best official source of information is the pages located on WoWAce (though they are extremely dated).

    Aside from Lua itself and how the syntax works, your other main reference will be the World of Warcraft API, so you can quickly find functions that may (or may not) exist to accomplish what you're after. WoWProgramming has a good full list, and if you want something more "sectioned" off then try the same basic API list from WoWPedia.

    You'll also want to bookmark the Events list available in-game, as well as the Lua functions that are innately built into the WoW client.

    Finally, to start playing around with Lua stuff as it related to WoW, one of the most helpful things you can do is grab two addons:
    WowLua: http://www.wowinterface.com/download...66-WowLua.html
    DevTools: http://www.wowinterface.com/download...-DevTools.html

    WowLua in particular is immensely helpful when learning Lua and how it can be utilized within WoW, because the addon allows you to essentially "simulate" an Lua environment and run commands or write scripts from in-game. You can create infinite "pages", save them for later use, and essentially write Lua code to your heart's content. It's a must have for sure.

    DevTools isn't nearly as vital, but it adds one very useful /slash command which is /dump. Using this command with ANYTHING following it will output the results in a nice, human-readable format. Another lifesaver for sure.

    Quote Originally Posted by Krazyito View Post
    1) Next my actual questions. When I was scouring the net I found this thread: http://www.wowace.com/addons/project...-progress-bar/

    Basically could you tell me what this portion of the code is used for?

    Code:
    function(_, _, message, _, _, source, _, destGUID, dest, _, _, spellName)
    All the other code I've seen uses that space empty in front of function(). What is this space used for?
    I'm a little confused by your use of the words "in front of function" since I see nothing in your example that is in front of it. I'm going to assume you mean the underscore (_) within the parameter list for now, but correct me if I am misunderstanding (and if so, provide an example of the other code you're seeing that you are referencing).

    The use of the underscore for most people is just simply a placeholder variable; a shorter way to fill that parameter than would otherwise be necessary.

    In Lua, an identifier (often thought of as a variable from other languages) can be defined by basically any alphanumeric series of characters, and also an underscore. So for example, these two snippets would produce identical results:

    Code:
    local foo = 'bar'
    
    function MyFunction(value)
      print(value)
    end
    
    MyFunction(foo)
    Code:
    local _ = 'bar'
    
    function MyFunction(value)
      print(value)
    end
    
    MyFunction(_)
    In both cases, we're just passing our initialized variable at the top (with an identifier of foo in the first and _ in the second) to MyFunction, which then prints it out. So the result of both would be output of the string bar.

    So, when you see code like your example, where underscores are used within a series of parameters, it is just shorthand for the author of the code to insert a parameter into that place without writing a longer identifier. It allows the function to accept the required number of total parameters, but by using proper named identifiers for the parameters we care about, and then underscores otherwise, it saves us from typing more than necessary (and makes the code look cleaner to many people). Let's see how this is used in your example:

    This function snippet is being used in a trigger function for the event COMBAT_LOG_EVENT_UNFILTERED, which is a very complex event that is fired for basically everything that occurs in game related to combat. By tracking that event, WeakAuras will pass along all the arguments into the Trigger function seen below:

    Code:
    function(_, _, message, _, _, source, _, destGUID, dest, _, _, spellName)
    The author wishes to make use of five of the arguments passed by the COMBAT_LOG_EVENT_UNFILTERED event, and ignore the others. However, if we were to simply rewrite the function and parameter list with proper/appropriate names for everything that is being passed into the function from above, it would look like this:

    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, source, sourceFlags, destGUID, dest, destFlags, spellId, spellName)
    By utilizing the underscores for parameters such as event or timestamp, the author is saving him or herself a bit of typing (and making it easier to read), but from the perspective of Lua or the functions specifically, there is no impact using proper names or underscores.

    So if we look at the full function with that in mind, you can get a sense of what is being accomplished:

    Code:
    function(_, _, message, _, _, source, _, destGUID, dest, _, _, spellName)
        if (message == "SPELL_AURA_APPLIED" and UnitIsUnit(source or "", "player") and spellName and spellName:find("Polymorph")) then
            WeakAuras_Polymorph_Mob_Name = dest
            WeakAuras_Polymorph_Start = GetTime()
            return true
        end
        if (message == "SPELL_AURA_REFRESH" and UnitIsUnit(source or "", "player") and spellName and spellName:find("Polymorph")) then
            WeakAuras_Polymorph_Start = GetTime()
        end
        return false
    end
    The author is only utilizing the parameters of message, source, and spellName in fact, as passed in from the COMBAT_LOG_EVENT_UNFILTERED event. Thus the actual function and parameters could be cleaned up even more to get rid of more unused parameters (though it is only for visibility):

    Code:
    function(_, _, message, _, _, source, _, _, _, _, _, spellName)
    Hope that answers that question but as I said, let me know if not.

    Quote Originally Posted by Krazyito View Post
    2) Are variables I make in a custom trigger local to all parts of that specific aura? (such as custom untrigger / duration info / display, etc...)
    Technically not "local" variables, as defined by: local foo = 'bar', but yes if you leave off the local declaration, the variable will become "scoped" to the parent scope that houses all the functions within your Display, and be available across them all.

    For example, consider two basic functions:

    Code:
    function foo()
       print(myVar)
    end
    
    function bar()
       local myVar = 'hello'
    end
    If we execute the code:

    Code:
    foo()
    bar()
    foo()
    We get the output:

    Code:
    nil
    nil
    Nil is printed both times because by using the local declaration for myVar, that variable is "scoped" to only within our bar function, and an identifier with the same name used elsewhere is considered unique and separate within Lua, so print(myVar) in foo considers it nil.

    However, by removing the local declaration, like so:

    Code:
    function foo()
       print(myVar)
    end
    
    function bar()
       myVar = 'hello'
    end
    And then performing the same execution afterward:

    Code:
    foo()
    bar()
    foo()
    We get the following output:

    Code:
    nil
    hello
    The first time foo runs the myVar variable is nil, but after bar is run it now exists outside of the function scope where it was declared, and thus the second call to foo results in the expected output of hello.

    TLDR; I personally don't like relying on it, but yes if you don't declare variables locally, you can access them within WeakAura Displays.

    Quote Originally Posted by Krazyito View Post
    3) Is there a way to make multiple instances of an aura based on specific units? Example: I have boss1 that I want to track energy of. but during he spawns a boss2 and boss3 that I also want to see the enrgy of for the same purpose / triggers of that aura. I understand how I can get the name of the bosses and label them, I just don't know how to make the extra instances without just making a whole new aura for each specific boss.
    Again I may not fully understand the question, but one slick feature WeakAuras has is called Auto-Cloning, which in some situations allows WeakAuras to dynamically create duplicate Displays for multiple targets of the same trigger (such as Auras and such). However, the availability of this function is very limited, and most importantly, I don't believe it can be used for any non-friendly units. (For future reference, you'll see an Auto-Cloning popup when you are selecting "Multiple Targets" in your Trigger setup).

    So the short answer is, for tracking energy and specifically of enemies, just right-click > Duplicate is your best bet. If you stick them all in a Dynamic Group, you can make WeakAuras display then in a pretty way and space them out and all that.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •