Register

WeakAuras - Bleed Ratios

Pimp your interface.

Moderator: Forum Administrators

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

WeakAuras - Bleed Ratios

Postby Collie » Thu Dec 06, 2012 2:45 pm

A while ago I coded up a WeakAuras group specifically for tracking Rip and Rake. It was very simple: all it did was show how much stronger (or weaker) a new Rip or Rake would be on your target. It became decently popular over time, but I quit the game for a while and left it to bitrot.

In that time, the great Stenhaldi picked up where I left off, improving the code performance, adding improved functionality, and including a tracker for Thrash. I'd absolutely recommend using his version, which you can find by clicking here: viewtopic.php?f=11&t=4446&p=18611#p18611

For documenting purposes only, I've included most of the original post and revision below.
Spoiler: show
Hey kitties. I've coded up a WeakAuras group to display Rake and Rip ratios on your current target (inspired by DroodFocus and Leafkiller's implementation in Ovale,) and I'd like some feedback. I know this may not automatically appeal to most people visually since it's themed around my UI, but primarily I'd like some feedback on its accuracy and computing performance. I'm not sure how (in)efficiently the code runs or what the optimal display settings are, so improvements would be great.

There are two numerical readouts: one for Rake, and one for Rip. A snapshot mechanism tracks when you apply Rake/Rip on your target and captures your AP, mastery, and damage multiplier at that time, which is then weighed against a potential new Rake/Rip based on your current AP and so on. The numbers change based on the percent difference between them - if your potential Rake/Rip is weaker than the one currently on the target, it will be gray; if the potential bleed is stronger, the numbers will be green; if the potential bleed is stronger *and* will yield a higher DPE, the numbers will turn orange.

Here's a preview of the Rake display. Rip shows to the right of it. The pink display to the left is for Weakened Armor, which isn't part of this, and neither are the debuff icons/timers above the readouts. (That's Pitbull.)
Image


And the code for anyone who is interested: http://pastebin.com/LJbumGsV

The font being used is Micron55 if it turns up missing for anyone. This version uses Blizzard's CP detection, so everything should work right out of the box.

Import string for the WeakAura:
http://pastebin.com/pLFg4F6W

Please lend me your thoughts if you get the chance!

Change log:
Dec. 06 - Original post.
Dec. 13 - Did a little bit of code clean-up.
Dec. 15 - AP variable fixed to include base/positive/negative attributes.
Dec. 27 - Removed erroneous variable.
Feb. 15 - Added mention of commented code.
Mar. 14 - Clarified what this display group will look like upon importing.
Sep. 15 - Replaced original post with credit and promotion for Stenhaldi's version.

For those not already using WeakAuras that would like to try this out, you can find the newest version of the addon here:
http://www.curse.com/addons/wow/weakauras-2
Last edited by Collie on Sun Sep 15, 2013 5:53 pm, edited 10 times in total.
// Collie, US-Drenden

Honored
User avatar
Posts: 67
Joined: Sat Dec 08, 2012 3:35 pm

Re: WeakAuras - Bleed Ratios

Postby Vami » Thu Dec 13, 2012 12:03 pm

I just want to say that this is awesome. It's so small and neat, but still incredibly informative and just the thing I was looking for! I don't use DroodFocus or Ovale at the moment, so uploading them just to see the ratios would feel a bit stupid... Thank you for sharing, at least one cat druid here is very happy! (:

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

Re: WeakAuras - Bleed Ratios

Postby Collie » Thu Dec 13, 2012 1:03 pm

Thanks! /hug

Also, I updated the code previews, and the import string in PasteBin. Nothing worth mentioning aside from a small amount of streamlining. (I'm still learning tricks in Lua and all that.)
// Collie, US-Drenden

Honored
Posts: 67
Joined: Mon Sep 10, 2012 3:12 am

Re: WeakAuras - Bleed Ratios

Postby Etapicx » Tue Dec 25, 2012 3:06 pm

I'm pretty sure i broke it somehow when i import them the only thing i get is two black boxes, I tried to go on the dummy and nothing happends i did as well try to select an other font if that was the problem... any suggestions?
Also you wouldn't mind me quoting this or linking it on my feral guide on mmo-champion would you?
Image

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

Re: WeakAuras - Bleed Ratios

Postby Collie » Thu Dec 27, 2012 1:04 pm

Etapicx wrote:I'm pretty sure i broke it somehow when i import them the only thing i get is two black boxes, I tried to go on the dummy and nothing happends i did as well try to select an other font if that was the problem... any suggestions?
Also you wouldn't mind me quoting this or linking it on my feral guide on mmo-champion would you?

That very well could have been my mistake; it seems like I accidentally tried to declare an extra variable in the Stat Logic display. I have to try and keep tabs on the changes I make to my own personal version (which depends on other WA displays) to then carry over to this, the independent version, which clearly don't always make it. The PasteBin has been updated accordingly.

Separately, I do believe at some recent point WA changed the way it layers displays by depth - instead of sorting them top-down, it now does it bottom-up. It may also take a /reload after importing for this thing to get a kick in the head and start working. Now that I'm back from the holidays, I've a bit of free time to play around with different presentation ideas that can maybe avoid this whole problem. As far as suggestions, you can move/hide the black background cards to see if there's any text being displayed at all. Was this giving you any LUA errors?

You're also more than welcome to link it where ever you think it'd be appropriate. I would recommend linking this topic or the PasteBin URL rather than the raw import code since... Well, as you can see, it changes fairly often.
// Collie, US-Drenden

Honored
Posts: 67
Joined: Mon Sep 10, 2012 3:12 am

Re: WeakAuras - Bleed Ratios

Postby Etapicx » Fri Dec 28, 2012 2:05 pm

Works perfect :-)
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Mon Feb 11, 2013 9:23 am

Quick question: Is TF used somewhere in there for calculations? I could be wrong but I only see DamageMultiplier modified for DoC and not for TF.
Image

Exalted
User avatar
Posts: 1369
Joined: Fri Nov 25, 2011 7:49 pm

Re: WeakAuras - Bleed Ratios

Postby aggixx » Tue Feb 12, 2013 2:39 am

If I understand correctly the trigger uses return value 7 of the UnitDamage function, which returns the player's global damage multiplier. DoC is only manually included because unlike other buffs (Tiger's Fury, Nature's Vigil, Tricks of the Trade) it isn't merely a global damage multiplier, but instead a buff that increases the damage of a specific list of spells and is therefore not included in UnitDamage.
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Tue Feb 12, 2013 7:27 pm

Makes sense. Thanks.
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Wed Feb 13, 2013 10:46 am

Works really well, thanks for this. It gets a little annoying trying to remember yourself exactly how strong your previous bleeds were at times. The only change I personally made was to replace the GetComboPoints function with just 5. It makes it a little easier to map out how much stronger it will be regardless of how many combo points I currently have since I shouldn't be using a 4 or less rip anyhow.

I have other changes I would like to fool around with, but that will be when I have some time to learn exactly what I'm doing rather than just a trial and error, lol.
Image

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

Re: WeakAuras - Bleed Ratios

Postby Collie » Fri Feb 15, 2013 12:36 pm

I'm glad you guys are finding this useful. Sadly however, my raid team fell apart, and due to that - in addition to a lack of interest/entertainment - I stopped playing more than a month ago. It's safe to assume this will break with time (looking at you, 5.2,) but the basic structure is something anybody could take and transform into a workable state. For those of you looking to do that, you can view a commented version of the code here. Should help explain what's going on, but it's going to be best viewed in something like Notepad++ due to the line width.

/huggles
// Collie, US-Drenden

Posts: 8
Joined: Thu Mar 14, 2013 12:12 am

Re: WeakAuras - Bleed Ratios

Postby Sinilye » Thu Mar 14, 2013 12:15 am

Hey guys - long time lurker, first time poster.

I caught this thread and noticed how interesting it is towards knowing when to reapply a stronger bleed than previously one.

My question is, how do I go about to implement these strings and imports? I just downloaded WeakAuras and for some strange reason, I'm unable to edit or setup properly (want it similar to your picture Collie)
Image

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

Re: WeakAuras - Bleed Ratios

Postby Collie » Thu Mar 14, 2013 3:03 am

What does it look like for you? You might be importing it just fine and don't know any better because the demo image I used for this is, admittedly, pretty misleading. At least without a proper disclaimer. This aura group ONLY provides the black boxes and the text, not the pink box (that was my aura for FFF) nor the debuff icons/times above the black boxes (those are PitBull, as is the gray HP bar/text below.) So if that's all you see, you've done all that's necessary to start using it.

I probably should have mentioned that at the start, huh?
Last edited by Collie on Thu Mar 14, 2013 3:05 am, edited 1 time in total.
// Collie, US-Drenden

Posts: 8
Joined: Thu Mar 14, 2013 12:12 am

Re: WeakAuras - Bleed Ratios

Postby Sinilye » Thu Mar 14, 2013 3:05 am

It's just showing the black boxes - not the Rip/Rake images or clock timers (like presented in your picture). Thats what I was aiming for if possible.

edit: http://i.imgur.com/780q2JY.jpg?1

that's what I get. If I knew how to add the icons, it would make things better so I can get rid of addons
Image

User avatar
Posts: 13
Joined: Sun Sep 16, 2012 1:32 pm

Re: WeakAuras - Bleed Ratios

Postby Collie » Thu Mar 14, 2013 3:22 am

Ah. Well, unfortunately I can't be of too much help there. The most I can say is you'll have to use some kind of aura tracking add-on or WA display to get the actual debuff icons for Rip and Rake and so on, or at least ones that will have static positions (unlike the dynamically ordered bars you have.) I know that's a pretty nebulous suggestion but I haven't played the game or held a subscription in a few months, and I don't have any particular desire to start playing any time soon; this is the closest thing to WoW I still pay attention to, though obviously that only does so much good.

All this display is built to do is attach (well, have you attach) the readouts to those icons. Creating your own WA displays for Rake/Rip is pretty easy if you enjoy experimenting with these sort of things. There's also an easy-to-follow tutorial provided by WA's author here. It's not for exactly what you want, but it should be a good place to start.
// Collie, US-Drenden

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Thu Mar 14, 2013 12:55 pm

I remember I had to do some tweaking to get everything working right. I'll try to get you some insight to what I did later on (hopefully I don't forget like I did in the other thread -_- ).
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Thu Mar 14, 2013 2:47 pm

http://pastebin.com/7UbvcYwT

I don't really remember what I did to get everything working the way I wanted it to, so I just copied/grouped up some things and it'll show you how I have my two bleeds with some small changes. (granted, this also includes a minor change where the calculation shows what it would be if you had a 5 CP rip as opposed to how many current CPs you actually have. see above) Hopefully that helps.
Image

Posts: 8
Joined: Thu Mar 14, 2013 12:12 am

Re: WeakAuras - Bleed Ratios

Postby Sinilye » Fri Mar 15, 2013 4:07 am

Thanks for the help/info. I got the text/bars working and added icons which seem to be helping!

I haven't tested your setup yet, Dysheki, as I'm still getting used to the addon itself
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Fri Mar 15, 2013 4:15 pm

Okay, great. If you have them setup and working then fit it into your UI the way you want it. It may seem daunting to come into an addon that has so many features, but sometimes the best way to get it the way you want it is just to sit down and fool around with it for a while.

Good luck!
Image

Exalted
User avatar
Posts: 503
Joined: Wed Jun 29, 2011 4:49 am

Re: WeakAuras - Bleed Ratios

Postby Stenhaldi » Fri Apr 12, 2013 6:39 pm

Edit: click here for latest version

This is the version that I've been using. (Well, it sort of is -- I had to make some changes so that it would work apart from the rest of my UI. Hopefully I didn't break anything in doing this.)

Weakauras import string

Changes from the version in this thread:
  • Snapshots crit chance (5.2 change) and accounts for this in the tick ratio calculations.
  • Remembers bleed strength on multiple targets.
  • Remembers how many CP you used rip at (but assumes you will use it at 5 CP).
  • Accounts for missed attacks (by checking for aura application/refresh instead of spellcast)
  • Includes thrash-cat.

Notes:
  • Still does not understand soul swap and will create new snapshots on the target when you use it.
  • Assumes boss level target (3% crit suppression).
  • Assumes 3% crit damage meta (if you're using the legendary meta, you should change the 1.06 in Feral Stat Logic to a 1).
  • I implemented some (.6 seconds) latency protection for Dream of Cenarius since it usually expires before the bleed it affects is applied. There could still be inaccurate results at very high latency values.

The code-

Feral Stat Logic
Spoiler: show
updates on every frame
Code: Select all
function()
    local APBase, APPos, APNeg = UnitAttackPower("player")
    local DoCSID = select(11, UnitAura("player", "Dream of Cenarius"))
    AP, DamageMultiplier, Mastery, CritEffMult = (APBase + APPos + APNeg), select(7, UnitDamage("player")), (1 + (GetMasteryEffect() / 100)), (1+1.06*(GetCritChance()-3)/100)
    if GetComboPoints("player", "target") <= 1 then
        ComboPoints = FeralCP_spent
    else ComboPoints = GetComboPoints("player", "target")
    end
    DoC_active = DoC_active or  0
    if DoCSID == 108381 then
        DoC_active = GetTime()
        DamageMultiplier = DamageMultiplier * 1.25
    elseif GetTime() - DoC_active < .6 then -- account for latency
        DamageMultiplier = DamageMultiplier * 1.25
    end
   
    return ''
end

Feral Snapshot Logic
Spoiler: show
triggers on COMBAT_LOG_EVENT_UNFILTERED,PLAYER_REGEN_ENABLED,PLAYER_ENTERING_WORLD,PLAYER_ALIVE
Code: Select all
function (event, ...)
    Rip_sDamage = Rip_sDamage or {}
    Rake_sDamage = Rake_sDamage or {}
    Thrash_sDamage = Thrash_sDamage or {}
    if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
        local _, param, _, source, _, _, _, destination, _, _, _, spell, _, _, _, _, _, _, _, _, _ = ...
        if (source == UnitGUID("player") and (param == "SPELL_AURA_APPLIED" or param == "SPELL_AURA_REFRESH")) then
            if (spell == 1079) then
                Rip_sDamage[destination] = (113+320*ComboPoints+0.0484*ComboPoints*AP)*DamageMultiplier*Mastery*CritEffMult
            elseif(spell == 1822) then
                Rake_sDamage[destination] = (99+AP*0.3)*Mastery*DamageMultiplier*CritEffMult
            elseif(spell == 106830) then
                Thrash_sDamage[destination] = (686+0.141*AP)*Mastery*DamageMultiplier*CritEffMult
            end
        end
    elseif (not UnitAffectingCombat("player")) and (not UnitGUID("boss1")) then
        Rip_sDamage = {} -- clean up out of combat
        Rake_sDamage = {}
        Thrash_sDamage = {}
    end
end

Rake Ratio
Spoiler: show
triggers on rake aura name, updates display every frame
Code: Select all
function()
    Rake_sDamage = Rake_sDamage or {}
    if Rake_sDamage[UnitGUID("target")] then
        local Rake_pDamage = (99+AP*0.3)*Mastery*DamageMultiplier*CritEffMult
        local Rake_Ratio = (Rake_pDamage / Rake_sDamage[UnitGUID("target")])
        local Rake_RatioPercent = (Rake_Ratio * 100)
        if (Rake_RatioPercent >= 110) then
            return format("|cFF00FF00%d|r", Rake_RatioPercent)
        elseif (Rake_RatioPercent <= 90) then
            return format("|cFFFF0000%d|r", Rake_RatioPercent)
        else
            return format("|cFF999999%d|r", Rake_RatioPercent)
        end
    else return ''
    end
end

Rip Ratio
Spoiler: show
updates on rip aura name, updates display every frame
Code: Select all
function()
    Rip_sDamage = Rip_sDamage or {}
    if Rip_sDamage[UnitGUID("target")] then
        local Rip_pDamage = (113+320*5+0.0484*5*AP)*DamageMultiplier*Mastery*CritEffMult
        local Rip_Ratio = (Rip_pDamage / Rip_sDamage[UnitGUID("target")])
        local Rip_RatioPercent = (Rip_Ratio * 100)
        if (Rip_RatioPercent >= 110) then
            return format("|cFF00FF00%d|r", Rip_RatioPercent)
        elseif (Rip_RatioPercent <= 90) then
            return format("|cFFFF0000%d|r", Rip_RatioPercent)
        else
            return format("|cFF999999%d|r", Rip_RatioPercent)
        end       
    else return ''
    end
end

ThrashCat Ratio
Spoiler: show
triggers on thrash-cat aura spellid, updates display every frame
Code: Select all
function()
    Thrash_sDamage = Thrash_sDamage or {}
    if Thrash_sDamage[UnitGUID("target")] then
        local Thrash_pDamage = (686+0.141*AP)*Mastery*DamageMultiplier*CritEffMult
        local Thrash_Ratio = (Thrash_pDamage / Thrash_sDamage[UnitGUID("target")])
        local Thrash_RatioPercent = (Thrash_Ratio * 100)
        if (Thrash_RatioPercent >= 110) then
            return format("|cFF00FF00%d|r", Thrash_RatioPercent)
        elseif (Thrash_RatioPercent <= 90) then
            return format("|cFFFF0000%d|r", Thrash_RatioPercent)
        else
            return format("|cFF999999%d|r", Thrash_RatioPercent)
        end       
    else return ''
    end
end

Feral CP Snapshot
Spoiler: show
triggers on UNIT_COMBO_POINTS,PLAYER_TARGET_CHANGED
Code: Select all
function (event, unit)
    if event == "UNIT_COMBO_POINTS" and unit == "player" then
        if GetComboPoints("player", "target") == 0 then
            FeralCP_spent = FeralCP_count
        end
        FeralCP_count = GetComboPoints("player", "target")
    elseif event == "PLAYER_TARGET_CHANGED" then
        FeralCP_count = GetComboPoints("player", "target")
    end
end
Last edited by Stenhaldi on Tue Jun 03, 2014 3:24 am, edited 2 times in total.

Honored
User avatar
Posts: 67
Joined: Sat Dec 08, 2012 3:35 pm

Re: WeakAuras - Bleed Ratios

Postby Vami » Sat Apr 13, 2013 5:10 am

Nice, I've been waiting for someone to update this. I don't know lua that much so it'd be time consuming and pretty tedious if I tried to do that myself so... Thank you! :) You made all the changes I longed for. <3

I tested it on the dummy and it worked well for me at least. (I also noticed that switching from Agile Primal Diamond to the legendary meta had made my Rune proc crit so thank you for notifying me about that, too... :D ) I tried creating backgrounds for the numbers but they ended up sitting assertively on the numbers instead of being under them. Oh well, may try to do that some other time. At least the ratios work really well now.

Exalted
User avatar
Posts: 503
Joined: Wed Jun 29, 2011 4:49 am

Re: WeakAuras - Bleed Ratios

Postby Stenhaldi » Sat Apr 13, 2013 6:20 am

Vami wrote: I tried creating backgrounds for the numbers but they ended up sitting assertively on the numbers instead of being under them.

Make sure the background has a lower frame strata (set at the bottom of the display tab).

Honored
User avatar
Posts: 67
Joined: Sat Dec 08, 2012 3:35 pm

Re: WeakAuras - Bleed Ratios

Postby Vami » Sat Apr 13, 2013 10:56 am

Ah, must've missed that option. Thanks.

Honored
User avatar
Posts: 57
Joined: Thu Nov 25, 2010 7:28 am

Re: WeakAuras - Bleed Ratios

Postby Ekthelion » Thu Jun 27, 2013 8:45 am

On PTR the Rip aura is going crazy sometimes (ratio over 10000?). Will try to investigate during the next testing.
Da Vuhdo iz wid'ya mon!
Image

Revered
Posts: 226
Joined: Tue Jun 28, 2011 10:41 am

Re: WeakAuras - Bleed Ratios

Postby Dysheki » Thu Jun 27, 2013 11:51 am

All this talk about the crit involved with Rentakis vs RoR made me want to look into changing what I have for code but I've been too lazy to take a peak when I'm at home, lol. Thanks for your updates Stenhaldi.
Image

Next

Return to Addons / UI

Who is online

Users browsing this forum: Google [Bot] and 6 guests