1. #1

    [WA] Trigger only when I'm in an instance or raid?

    Hey guys. I have a pretty simple Healthbar at the center of my screen on my guardian druid and currently I can choose to have it trigger in combat or always etc. I want to know is there a way to make it trigger only when I enter a dungeon or raid?

    To clarify. I want it to be always on while in dungeons and always off while outside of dungeons regardless of combat state.

    Side note: My health bar display my full health. Example: 2294279. Is there a way to make it round up for example 2.2mil etc?
    Last edited by KalinPopov; 2016-11-30 at 06:33 AM.

  2. #2
    /wa
    Go into your aura
    select it
    Look for "LOAD" Tab

  3. #3
    I can only set it to one specific thing. Like a dungeon or a raid. Is there a way to do both?

    Also any idea about the health thing?

  4. #4
    if you tick the option again it will let you tick multiple instance types

    as for health depending on how you want to round it up and depending on your unit frames as some don't like this code for whatever reason

    Code:
    function()
    local v = UnitHealth(unit)
    	if abs(v) >= 1e9 then
    		return format("%.2fB", v / 1e9)
    	elseif abs(v) >= 1e6 then
    		return format("%.2fM", v / 1e6)
    	elseif abs(v) >= 1e3 then
    		return format("%.1fK", v / 1e3)
    	else
    		return format("%d", v)
    	end
    end
    That code works as i use it on my health bars, Function() part might not be required

  5. #5
    Thanks. It's not for my unit frames specifically. I'm using Zperl and they are rounding it up at the hundreds of thousands. I have a WA that is just a health bar with heal in it seperate from any unit frames and that's what I wanna change. I'll see if the code is applicable to it.

  6. #6
    for the code rename the unit to "player" or whatever you want it to track

  7. #7
    Ok I'm doing something wrong. My WA for the healthbar is already using code to do it's work. I found it on the wow forums it was about mana but it was easy to change the words mana to health and it worked. This is the code:

    Code:
    function()
        local p = math.max(0, UnitHealth("player")) / math.max(1, UnitHealthMax("player")) * 100;
        return string.format("%.f", p) .. "%%";
    end
    I was wondering if you could tell me how to incorporate your part into mine or if I should replace it all together. Replacing it altogether changed absolutely nothing in the way it worked. I was wondering if you could help me some more because obviously I'm not doing it properly.

  8. #8
    There's various ways to get hp displays for my code in WA

    Code:
    function()
    local v = UnitHealth("player")
    	if abs(v) >= 1e9 then
    		return format("%.1fB", v / 1e9)
    	elseif abs(v) >= 1e6 then
    		return format("%.1fM", v / 1e6)
    	elseif abs(v) >= 1e3 then
    		return format("%.1fK", v / 1e3)
    	else
    		return format("%d", v)
    	end
    end
    that should work and display hp like 2.2B, 2.2M etc, it worked when i was doing testing in WA before moving it into my addon. so just replace that where you have your code

  9. #9
    Works fine. One last thing. I added this function as a left text aka in the middle for me. But I also want to have right text thats at the end of the bar that shows just percentages. That's what my last code did. I got confused. I though the custom function was for the health but it was actually for the percentage. Now when I put both functions at custom. How do I separate them with yours being the middle on that shows raw hp and another one that stays at the end that shows percentages?

    I'm sorry for all this hassle I'm putting you through.

  10. #10
    Code:
    function()
    local p = (UnitHealth(unit)/UnitHealthMax(unit))*100
    return format("%.1f%", p)
    end

    That should work (I think if it doesn't remove the % after f) and it will display percent as a whole number basically (100 instead of 100%)

Posting Permissions

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