1. #1

    WeakAuras-LUA help needed.

    Hello, I am writing my own WA LUA and I am curious how I could a save a variable without it resetting.

    I need this to track Stormlash/Skull Banner this way, because they do not have a timer - I am making a suggesting script when to pop dps cooldowns and for that, knowing the current duration of these buffs is crucial.

    (dont mind the code errors)

    for i=1 to 40
    local BuffName,_,_,_,_,_,_,_,_=UnitBuff("player",i);
    if "Skull Banner" == BuffName then
    --[[Start Countdown timer from 10s-> 0s--]]

    --
    I was thinking of making a bool variable that gets true value every time Skull Banner goes up and false every time the buff disapears.
    a = GetTime()+10;
    CurrentDuration = a - GetTime(); (until >0)

    How can I do this without the timer resetting on me? Any type of values just reset as its all real time.
    I am open to other ideas on how to do it, however it needs to be in lua.

    Thank you.
    Last edited by Skey; 2013-10-15 at 10:26 PM.

  2. #2
    use combat log events and either monitor SPELL_CAST_SUCCESS or SPELL_SUMMON because both of those are triggered by Skull Banner and Stormlash.

  3. #3
    I will look into that, thank you for your answer.

  4. #4
    Make a new aura (icon) using the following in the custom trigger page and make sure %n is written under text in the display page, you will have to select the skull banner icon yourself as well.

    Event: COMBAT_LOG_EVENT_UNFILTERED

    Custom Trigger
    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
        if message == "SPELL_CAST_SUCCESS" then
            local spellId, spellName, spellSchool = ...
            if spellName == "Skull Banner" then   
                WA_RCD_Name = sourceName
                return true
            end
        end
    end

    Hide: Timed: Duration 10

    Name Info
    Code:
    function()
        return WA_RCD_Name
    end
    Last edited by suprep; 2013-10-16 at 03:24 PM.
    DarkStorm 25man 14/14 heroic, 5 days/15 hours - World Rank #44 http://www.darkstormguild.com
    YouTube - YouTube Videos of boss kills (10 and 25 HC)
    Twitch - Raids / Misc
    Suprea - Protection Warrior (Main)
    Suprep - Restoration Shaman

  5. #5
    Big ups man, I didn't have much time, but I will work with it over the weekend.

Posting Permissions

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