• 0

    posted a message on Been trying to make this code work for buff duration
    Hi! This code can be used for tracking any buff duration on a bar timer! When the buff duration timer matches the warning_time you set it will change the color on the bar!

    The code will read the color you pick in the WeakAuras Display Color Box and the Animation/Main Color Box.

    I have this code working for Vampiric Embrace but I'm sure it will work for any other buff.

    Why change the color on the bar for a buff?

    For me I have the Animation color set to red and the warning_time at 5 so when the buff has 5 seconds left on it...the bar color will change to red & I will know the buff duration is almost gone.

    On Weakauras you add this code in the animation tab on main. Select custom and put the code in the custom function box next to the color box.

    I also posted this same code format to work for spell cooldowns. If you do the math and set up the time right in weakauras (not the warning_time) you can have your buff timer bar appear first then have your cooldown timer bar appear next. Thanks to everyone on here that helped me out getting the codes to work right! :cool:

    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        -- Set the debuff and threshold time here:
        local debuff_name, warning_time = "Vampiric Embrace", 5
        
        local _,_,_,_,_,_,expires, etc = UnitAura("PLAYER", debuff_name,
        nil, "PLAYER|HELPFUL")
        if expires ~= nil then
            local time_left = expires - GetTime()
            if time_left < warning_time then
                return r2, g2, b2, a2
            end
        end
        return r1,g1,b1, a1
    end
    


    Posted in: Lua Code Discussion
  • 0

    posted a message on WeakAuras color changing lua code for Vamp-Em CD
    Here's a lua code for a WeakAuras Vampiric Embrace timer cooldown bar. It will change the color depending on the warning time you set.

    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable =
        GetSpellCooldown ("Vampiric Embrace")
        local warning_time = 60
        if start and start>0 then
            local progress = start + duration - GetTime()
            if progress < warning_time then
                return r2, g2, b2, a2  -- Display
            end
        end
        return r1, g1, b1, a1 -- Animation
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to get timer to change 000000.00 to 0.0 ?
    i don't need the 00000.0000 or whatever it's showing on the bar to show at all in the lua code. I just want to use the 0.0 time that's already built in weakauras in the display options. Can anyone help me out please?
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to get timer to change 000000.00 to 0.0 ?
    Hello, I used this import for weakauras but in the timer bars the time is going of as 00000.00 in that format when I use the 0.0 format that you can use already in weakauras. The 00000.00 timer format seems like is in the lua code it's self. Is there anyway to make it not show the time at all in the lua so I can use the time format in weakaura instead?

    here's a link to the pastebin if you want to check out what I mean on weakauras. http://pastebin.com/p3YKDC4J
    Posted in: Lua Code Discussion
  • 0

    posted a message on Please I Need Help With Color Bar Code For WeakAuras
    I checked it out and I ended up getting red errors right away as is. Not sure if I'll be able to use this much will just have to keep on messing with the code
    Posted in: Lua Code Discussion
  • 0

    posted a message on Whats the lua deal with Mind Blast CD?
    No I don't think it's affected by the haste because all it's doing is reading the cooldown time. If anything it would just countdown on the timer faster with hero ect. I'll find out later today when I raid.
    Posted in: Lua Code Discussion
  • 0

    posted a message on WeakAuras color changing lua code for shadowfiend
    Hey everyone I messed with the lua code till I was able to get it working for shadowfiend or mindbender ( just change the spell name ) This code will change the color on the weakauras timer bar depending on what you set the warning_time at. There is also a video on youtube about it here
    https://www.youtube.com/watch?v=CrR-7MrBG4g

    In the link I have other codes posted on the youtube video comments below for Mind Blast / Shadow Word: Death

    And here is the code for shadowfiend
    -- Right after Main below for Animation Make sure you set Time in to Relative or Seconds. For % progress I did 100% for Relative. Or you can have the Time in set to Seconds and % Progress at 1. The color change won't show up if you leave it blank.
    
    
    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable = GetSpellCooldown ("Shadowfiend")
        local warning_time = 7
        local progress = start + duration - GetTime("Shadowfiend")
        if start>0 then
            if progress < warning_time then
                return r2, g2, b2, a2 -- Display Color Box
            end
        end
        return r1 ,g1, b1, a1 -- Animation/Main Color Box
    end 
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on This Code will Work for Mind Blast CD but....
    This is a color changing code for weakauras timer bar cooldown. It will change the color depending on what you set your warning_time at. In other words it's a great way to track when you need to recast soon. I set my color for the warning_time all to red but you can choose whatever color you want.
    Here's a video link about the lua code on weakauras also on youtube
    https://www.youtube.com/watch?v=CrR-7MrBG4g

    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable = GetSpellCooldown ("Shadowfiend")
        local warning_time = 3
        local progress = start + duration - GetTime()
        if start>0 then
            if progress < warning_time then
                return r2, g2, b2, a2
            end
        end
        return r1,g1,b1, a1
    end   
    Posted in: Lua Code Discussion
  • 0

    posted a message on Color Bar Change for Shadowfiend or Mindbender
    Hey everyone I'm trying to figure out how to get this color change code for weakauras to work for shadowfiend or Mindbender. I could use a bit of help on it here's what I have so far I know it's not the correct input to make it work right.

    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable = GetSpellID("Shadowfiend")
        local warning_time = 3
        local progress = start + duration - GetTime()
        if start>0 then
            if progress < warning_time then
                return r2, g2, b2, a2
            end
        end
        return r1,g1,b1, a1
    end   
    Posted in: Lua Code Discussion
  • 0

    posted a message on Please I Need Help With Color Bar Code For WeakAuras
    So where I added Mind Blast change to spellID? Or change GetSpellCooldown to spellID?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Whats the lua deal with Mind Blast CD?
    I was able to figure out how to get Mind Blast CD to work for the color code in weakauras. I just need to figure out how to get it to work for Shadowfiend or Mindbender now. But here is the code incase anyone wants to use it. It will change the color on your bar timer for Mind Blast CD on weakauras depending what you set your warning time at. On Animation tab, main, scroll down till you see the color square box (this is where you set your color for warning time )
    to the right of that set it to custom & put the code in the box just to the left.

    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable = GetSpellCooldown("Mind Blast")
        local warning_time = 3
        local progress = start + duration - GetTime()
        if start>0 then
            if progress < warning_time then
                return r2, g2, b2, a2
            end
        end
        return r1,g1,b1, a1
    end   
    Posted in: Lua Code Discussion
  • 0

    posted a message on Please I Need Help With Color Bar Code For WeakAuras
    function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
        local start, duration, enable = GetSpellCooldown("Mind Blast")
        local warning_time = 3
        local progress = start + duration - GetTime()
        if start>0 then
            if progress < warning_time then
                return r2, g2, b2, a2
            end
        end
        return r1,g1,b1, a1
    end   
    


    This will change the color on the bar for the cooldown on Mind Blast depending when you set your warning time. ( Should work for Shadow Word: Death also just change the name ) This is to help you know when it's ready to cast again. set this code in the Custom Main on WeakAuras next to where the color block is.
    ( set color to red so you know when it's time to cast again soon )
    I didn't get any help getting this code I did trial and error till I got it right.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Whats the lua deal with Mind Blast CD?
    I see in some add-on's that they don't have a cool down timer for Mind Blast or Shadow Word: Death

    Is there some pacific command to use for it?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Please I Need Help With Color Bar Code For WeakAuras
    Most of the spells for a shadow priest will work for this code. It's only the spells that do not have a debuff or buff on a target or player that will not work. As soon as someone helps on this code for the spell cooldowns issue and gets it to work right we'll have 2 codes that can be used to make your own custom time meters on weakauras with!

    I'm hoping someone will show the correct lua code on here so it will work for Mind Blast or whatever kind of spell cooldown that doesn't leave a buff or debuff. It does show the cooldown on the action bar button Mind Blast by it's self so I know there has to be a code for it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Two frame Cooldown question
    Well for me I was able to do these kind of things on weakauras. There on the Animation tab you can monitor the duration by setting different number of seconds in the custom option. Once your in the custom option your have a lot more freedom on how you want your cooldown frame to act.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.