1. #1

    [Weak Aura] Custom Tracking Rejuvenation (or other buff/aura)

    Okay. I am having problems tracking my Rejuvenation on players and even myself with this custom weak aura. Here is what I have going on:

    Type: Custom
    Event Type: Event
    Event(s): COMBAT_LOG_EVENT_UNFILTERED

    Custom Trigger
    Code:
    function(event, ...)
        if event == "COMBAT_LOG_EVENT_UNFILTERED" then
            local _, cleuevent, _, sourceGUID, _, _, _, destGUID, destname, _, _, duration, spellid, spellname
            if cleuevent == "SPELL_AURA_APPLIED" then
                if sourceGUID == UnitGUID("player") and spellid == 774 then
                    WA_Rejuv_Count = WA_Rejuv_Count + 1
                    WA_Rejuv_Ticks = WA_Rejuv_Ticks + 6
                end
            end
            if cleuevent == "SPELL_AURA_REMOVED" then
                if sourceGUID == UnitGUID("player") and spellid == 774 then
                    WA_RejuvCount = WA_Rejuv_Count - 1
                end
            end
            if cleuevent == "SPELL_PERIODIC_HEAL" then
                if sourceGUID == UnitGUID("player") and spellid == 774 then
                    WA_Rejuv_Ticks = WA_Rejuv_Ticks - 1
                    WA_Rejuv_Healing = WA_Rejuv_Ticks * 25000
                end
            end
        end
        if WA_Rejuv_Count then
            WA_Rejuv_Act = true
            return true
        end
    end
    What my intention is is the following... First, I'd like to track the number of active Rejuvenations I have on members of my party. The problem I am having is that this does not even display when I'm in a solo group and cast the ability on myself. There must something wrong in the code that I cannot even get the weak aura to display true.

    Secondly (and eventually), I'd like to be able to track the amount of potential healing done by all of my remaining Rejuvenations. I am still trying to teach myself the code and scour through various Ace/MMO-C threads on Google to figure out a way to track this. At first glance it would likely be easy -- total ticks remaining multiplied by some variable of healing. The problem arises if Rejuvenation is removed early or overwritten and potential stacks are lost. This could lead to a false value being returned. I will hopefully have this figured out soon.

    Thank you for any help you have with the above!

  2. #2
    Well to start you need to add
    Code:
    = ...
    to the end of line 3. Otherwise you're not actually pulling any data out of the CLEU to create your variables, they'll just all be nil forever.

    Minor code help: since you only get one event type for each CLEU event, combine your three if statements into if-elseif-elseif. Then you can even take your sourceGUID and spellID checks outside the entire chunk(since they're the same every time) to save another few lines.

    Count help: Lua doesn't have typing, thus variables that you want to be numbers aren't initalized as 0; they're initalized as nil. your code is trying to add numbers to nil (not sure why you haven't gotten a Lua error for that). Before line 2 add
    Code:
    WA_Rejuv_Count = WA_Rejuv_Count or 0
    WA_Rejuv_Ticks = WA_Rejuv_Ticks or 0
    WA_Rejuv_Healing = WA_Rejuv_Healing or 0
    and then at the bottom of the function change
    Code:
        if WA_Rejuv_Count then
            WA_Rejuv_Act = true
            return true
        end
    to
    Code:
        if WA_Rejuv_Count > 0 then
            WA_Rejuv_Act = true
            return true
        else
            WA_Rejuv_Act = nil
        end
    Or just remove WA_Rejuv_Act entirely and replace it (wherever else you planned to use it) with WA_Rejuv_Count > 0

    After all that, you're missing a check for SPELL_AURA_REFRESH, which would add some number of ticks. Dispels would have a similar problem where you don't know how many ticks to add for that individual instance of Rejuv. You'll probably have to make a table with entries for each instance of Rejuv (indexed by destGUID) and it'll start to become a major pain in the ass. But it's possible.
    Last edited by pnutbutter; 2013-08-10 at 08:58 PM.

  3. #3
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    Code:
    diuUfaGiO0LuQqJsI4usuELsLywqXTij2Lizyq4yKILru1ZijnnsPRrsTnIk(MIyCIqNteSoLkQ7PkDqjSqLkPhQuftuKQlQG2OI0hjQ0jLiTscntqPBQuP2jr5NsunuLQAPkLNkLPQkUkOyRkvPVcr2lWFjvdM6Wk5Xk0KjYLf2mb(mOA0kWPH0QfrVwPImBsCBq2TK(TQA4e0YHQNlQPRY1LQTRO(UsfmErkNhIA)ObAapGgeOjbAsGhqlTYfiihhyQktuJqDcjGaXev1KyIQQwlqGkAvdAsOzHklKFI0oqBhhbTXE((qprAhOjOxhp0FTKYOinnnnECD8Ajylgp05GEls2NJ66q)18otJnvkKk03IK9z9cOFVELrXOkrrksrksrksrksrkcA4bC0F9bzHbODrAhOn2Z3h6js7GrO06cqlMJ6bAljj0d9xxk6hokC4bEg8aoq7WrHdpWbpG2HSWa0g757dbAJ989H0hGkfG2HcfsGwmh1ldA7P8DVRfp6WwUC1hU3HYE0Hr20sH9z42W0bTXE((q6hYcdqlMJ6bAJ989Hanb964H(RLeZr9WqFOqr(wqcXqdf58cEGHEaQuSNv(cCm05FhFmKlmLMog68VJpgYwqbg68VJpgtvwWZyOZ)o(ySTqLMQSGNXqlf5tUWuA6yOLI8jBbfyOLI8nvzbpJHwkY32cvAQYcEgdDQuPkJMMI0000k)XLcDwyOOuQeg6SWqrr2ckWqNfgkkTXb)Vc9lDQuPOinnnnQaAOiNxWd63xAST9hclS6fWSvOxS)(Ww6W0XsFdIkfPPPPPPPPrfqNfgkkYwqb97ln2TizFoQRd9xXsVQs05FhFmKTGc63xAyQONSfuucwHklKdCSLrFdIknnnnnnfPPPPPPPPPPPPrQqFls2N1lG(96r)sJuH(wKSpRxa971J(JtJGI000000000000ivOVfj7Z6fq)E9OFPrQqFls2N1lG(96rVl0AOinnnnnnnnnnnnECD8k9H3dksttttttthvjksttttttttrAAA6qjhOcOHICEbpOFFPX22FiSWQxaZwH(2WDx(EhMow6BquPPPPPinnnnnnnnQa6SWqrr2ckOFFPXUfj7ZrDDO)kw6vvIo)74JHSfuq)(sdtf9KTGIsWkuzHCGJTm6BquPPPPPPPinnnnnnnnnnnnsf6BrY(SEb0Vxp6xAKk03IK9z9cOFVE0QqRHI0000000000004X1XR0hEpOinnnnnnnDuLOinnnDuLOyuLahOHC5ceKJdmvTAvNmroA0Kic5vRvEniacurRAqBhqLUbGPQvfHw51IaHAeYprRQi0ceOIw1GwTd9GJchEGNbY0aAdcu4doWu5KGQjMOCqOEsct0mrJ8iacurBcGMYFjbEan8VsaEanOUYHcEah4ahOHkbABrY(8d(ACNcCA5bhOLbnnP0MAsQeaTzGmnArGaCaa
    Doing ticks will be too complicated, you would have to factor in haste buffs and all that while calculating the amount of ticks and such. It's really not worth it.
    Last edited by suprep; 2013-08-10 at 09:40 PM. Reason: Updated the code!

  4. #4
    Both of you have been amazing help. Pnutbutter, thank you so much for helping me understand a little bit more about code and how to write it more efficiently. Before I reloaded this page to post what was going on, I was able to actually get the weak aura to activate (but not deactivate, which I was figuring out as I saw this). So sincerely, thank you <3

    Suprep -- my friend. You have come to my aid twice in the past week. Thank you so much. This going to really help me track the most beneficial times to use my new ability come 5.4. Thanks again ^_^

Posting Permissions

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