WeakAuras

Threat Monitor

  • 11 posts
    #1 May 19, 2011 at 12:24 UTC - 0 likes

    hi, i want to create a text field for the current tps value.

    is there a way to get the needed data directly from recount/skada or do i have to handle the wow threat api.

    #2 May 19, 2011 at 12:53 UTC - 0 likes

    Personally I think that trying to pull this data from recount/skada instead of using WoW-API would be far more complicated and error-prone.

    Using the WoW-API itself on the other hand has the same problem as calculating DPS, it all depents on how you choose the time-intervals and when to track damage/threat.

    Personally I would create the following display:


    • Text display
    • Load in Combat
    • On Show custom code:
      WA_TPS_START_TIME = time()
    • Custom text function:
      local threatvalue = select(4, UnitDetailedThreatSituation("player", "target"))
      local totaltime = time() - WA_TPS_START_TIME
      local value = threatvalue / math.max(1, totaltime)

      if value == nil then
      return "0"
      elseif value >= 100000 then
      return ("%2.1fk"):format(value / 100000)
      else
      return ("%d"):format(value / 100)
      end
    • Text code: "%c"
    #3 May 19, 2011 at 16:05 UTC - 0 likes

    arg, i got a lot of lua errors if i try this code.

    Display Text: %c

    Custom Function:

    function()
    local threatvalue = select(4, UnitDetailedThreatSituation("player", "target"))
    local totaltime = time() - WA_TPS_START_TIME
    local value = threatvalue / math.max(1, totaltime)
    if value == nil then
    return "0"
    elseif value >= 100000 then
    return ("%2.1fk"):format(value / 100000)
    else
    return ("%d"):format(value / 100)
    end
    end
    

    .. what do i have to put into the Custom Trigger Function ???

    #4 May 19, 2011 at 16:08 UTC - 0 likes

    @CommanderSirow: Go

    The data from the WoW API has the problem that for example it does not show threat during mirror images. While Skada does this (AFAIK it estimates the threat...). Personally I used lightweight Addons like MyThreat, but they don't support Mirror Images anymore, so I "have to" include another "window" (Omen) to display this, currently. Pulling such data out from Omen (not sure if Skada does it properly...) would be great for a Minimalistic Addon I think.

    #5 May 20, 2011 at 00:25 UTC - 0 likes

    Unfortunately, Omen stores its threat information in a local variable called threatStore, which is not exposed to the global environment in any way (that I can see). As such, to pull information from Omen, you would either have to slightly alter the source code (to put threatStore in the global scope) or try to retrieve threat data in a very hacky way (like reading it directly from a bar in the Omen window).

    I'm still trying to figure out how Omen calculates threat under Mirror Images in the first place - although I previously assumed it simply re-purposed old threat estimation code based on damage dealt from Omen 2, I do not see any such code in the source files. If the method used is simple enough, it might be easier to simply adopt that method than to try to pull information from Omen in the first place.

    Edit: Nevermind, it does use Combat Log based threat estimation.

    Last edited May 20, 2011 by Mirrormn
    #6 May 21, 2011 at 11:24 UTC - 0 likes

    @Mirrormn:
    Working with text-display a bit I noticed that text custom code seems to get executed even if the display itsself is hidden. Was that intended or is there some bug behind this?
    Going one step further, how about adding an (advanced) option to tell when to update/call the custom-text function? (Similar to how custom triggers work, eg. either give a list of Events or use OnUpdate)

    EDIT:
    I just deleted the text-display with the custom-code functions, but it still seems to be exected, now thats wierd...

    @Genkidama:
    Fetch from Omen WINDOW (not omen internal)

    d8ZffaGouvCys(TQSlLITrkzFOk15PsDAumBvLxReOfPK6XukFJuLNrkStIK9Iy3e2VmksLggPQghQI(PsPHQezWWWvv1TrsNIs4yQQCoIWcrv1srvOftPA5u1dvc4PuSmuL8CKAIkbzQuXKrLPRYfvcPRsj6YkUokTrsPMhPiBMkz7eP(OsO(QsqnnIOVJQsFwjzwKIQrJeJNs6sKIYTuQUgQcUNsuRKOoUsi(lPIj)ioedvIHJy4ioedhd9)pLBNX6rmolz4tqZSrm2yPVhvNX6rmUyf2oMNiORfjhcHW(Eyrv(p3HXkZLCiecmUcI3f2sDeHNpiExyl1rSHFLNoCugri5qiecHqWphRxewRjPEHTuhrW1JvWX71jhcHqiecjhcHqiec77blPNWwQJiWPovYHqimF0tYHqiecHW(Eq75Srj8OoIaN6ujhcHqiecFpBQVGDLNoSCyl1rSHFLNo5qiecHq47zt9fwXYWfwoyPG5KsrD0D9)pL7XV2IKdHqiecHKdHqiecH99GzuEBuc))uUhFYHqiecHGRNpSGJBnpyx5dmIWFfJNwx7kpTfbUxYHqiecHqiecmUc2v(noJ17xqj4c2v(noJ1tJGsWfSR8BCgR3p(S45CgRNUwewE5WkwgUWrzejhcH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u1kZAQMj7tkczgl4cbbbbbbbbxiiiiiiiObFOdO5ZH8JeiRS9WfcccccccccccA12F5H2D2HleeeeeeeuNC7bFOdOmmh60XXXXbYkBpCHGGGGGGGGGGGwT9xEi27VNswN854DwuIp9AQASpGMf60XXXXHfCHGGGGGGG6KBdxiiiiiiiiiiiOvB)LhI9(7f7SOeF61u1yFanl0PJdl4cbbbbbbb1(c4cbbb1(c42(IG892ASztVcMGyLRUAZ4hwq80(oSGuFSbT)gmb5A1LfmbPGM6Z)A0tbNb55Fn6PG8wUuz4HqLWK7lmuzst6tn0CiBm1SzfwybXwJnB6vWeeJxU6GCTQ9Vb5FBQxRA)BKUG0hT3cct5QRgezy)QnO9b5FBQw5QR2m(HfCgK)TP(9dl4miFFF0Eli1VrhK)TPwtghDWzqSYvxTz8dliEAFhwqk67tqOCBpLqm8qGoQj)gI)IEc61P2Nf0lDQ8hR(czLvd61P2V9THVGMcxOBjnfUqm8qGoQj)gQ6lG4L(dvxnuY4ADrwbz1Bg0EgE5QdI1zAbzueKxNApet5QRwqk7XMslOC2o5KroKDEU5qoCZD25ZjLG)28ChKe6ArWeK)TP(qpLUQfCgwqOWOWkdkNN7uslhopDotjVtoPCMXG)28zhwqUbzDMwNGCeC0zEhNWIa
    
    Last edited May 21, 2011 by CommanderSirow
    #7 May 21, 2011 at 17:21 UTC - 0 likes

    man i love u, the first string works as i looked for. i've set the omen window to 0% alpha and i only see the raw tps number :) the skada-like string only floods my chat with "- - -> 1" every second.

    but nonetheless, thank u for ur great support

    Last edited May 21, 2011 by Genkidama
    #8 May 21, 2011 at 20:01 UTC - 0 likes

    @CommanderSirow: Go

    Quote from CommanderSirow:

    Working with text-display a bit I noticed that text custom code seems to get executed even if the display itsself is hidden. Was that intended or is there some bug behind this?

    I'm not sure I would call that a "bug" per se; there is just no explicit code that prevents updates when the display is hidden.

    Quote from CommanderSirow:

    Going one step further, how about adding an (advanced) option to tell when to update/call the custom-text function? (Similar to how custom triggers work, eg. either give a list of Events or use OnUpdate)

    I'm actually adding that right now.

    Quote from CommanderSirow:

    EDIT: I just deleted the text-display with the custom-code functions, but it still seems to be exected, now thats wierd...

    That's an oversight in the Delete code. Will be fixed in r151.

    Last edited May 21, 2011 by Mirrormn
    #9 May 22, 2011 at 10:40 UTC - 0 likes

    @Genkidama: Go @Spam: Wooops, forget to remove that debug message. How to fix: Open the custom-code function. delete all "print(...)" statements. ;)
    Should work after that^^

    @Mirrormn: Go Thx for the quick replay. :)

    Quote:

    That's an oversight in the Delete code. Will be fixed in r151.

    Thats good, my first guess was that I somehow broke something, good to know that the fix was a simple one. :)

    Last edited May 22, 2011 by CommanderSirow
    #10 Aug 15, 2011 at 21:59 UTC - 0 likes

    Is there a way to create a threat-bar? I know how to get the percentage of my threat to be written on the bar. but the bar is always full.

    #11 Sep 05, 2011 at 09:31 UTC - 0 likes

    This should work with a custom duration function:

    function()
        local threat_pct = select(4, UnitDetailedThreatSituation("player", "target")) or 0
        return threat_pct, 100, true
    end
    
  • 11 posts

You must login to post a comment. Don't have an account? Register to get one!