Page 91 of 111 FirstFirst ... 41818990919293101 ... LastLast
Results 901 to 910 of 1109

Thread: WeakAuras Tutoring Thread

  1. #901

    Default

    Hey I'm currently trying to make a weak aura for Flamebender that will mark the people who get fixate with Star, Diamond and Circle. Does anyone have an aura that will do this? I'm not quite sure how to do it, but I don't see an option in bigwigs/dbm to auto mark people who are fixated, so I'm resorting to this. Any help would be greatly appreciated. Something similar to the blackhand "Left, middle, right" aura only marking the targets with those 3 markers. I know for that aura everyone needs to have it loaded to work effectively and assume this would have to do the same though if there's a way to make it so just 1 person needs to load it and the marks will go out that will work as well.

    Not even sure if this is possible, but I know DBM and Bigwigs have auto mark features, just doesn't seem to exist for flamebender fixates.
    Last edited by Octa; 03-29-2015 at 04:46 PM.

  2. #902

    Default

    To be honest, this sounds like a good idea and I would just contact BW and DBM authors to implement it!

    I put together an aura that should do the job though: pastebin
    It has two triggers and some extra code in the OnInit/OnShow.
    1) The OnInit is just there to init the variables we need:
    Code:
    aura_env.counter = 1
    aura_env.dest = nil
    aura_env.difficultyID = nil
    2) The first trigger is the one handling the application of the Fixate debuff by the wolves and saves the target. Listens to COMBAT_LOG_EVENT_UNFILTERED.
    Trigger:
    Code:
    function(event, ...)
        if select(2, ...) == "SPELL_AURA_APPLIED" and select(12, ...) == 154952 then
            aura_env.dest = select(9, ...)
            return true
        end
        return false
    end
    Untrigger:
    Code:
    function()
        aura_env.dest = nil
        return true
    end
    3) The second trigger is for the entire Flamebender encounter and is basically just there to grab the difficulty and reset the mark counter in the case of a wipe. Listens to ENCOUNTER_START, ENCOUNTER_END.
    Trigger:
    Code:
    function(event, encounterID, encounterName, difficultyID, raidSize)
        if event == "ENCOUNTER_START" and encounterID == 1689 then
            aura_env.difficultyID = difficultyID
            return true
        end
        return false
    end
    Untrigger:
    Code:
    function(event, encounterID, encounterName, difficultyID, raidSize)
        if event == "ENCOUNTER_END" and encounterID == 1689 then
            aura_env.difficultyID = nil
            aura_env.counter = 1
            return true
        end
        return false
    end
    4) The OnShow is where the actual marking happens:
    Code:
    if aura_env.dest and aura_env.counter then
        local icon = GetRaidTargetIndex(aura_env.dest)
        if not (icon and icon == aura_env.counter) then
            SetRaidTarget(aura_env.dest, aura_env.counter)
        end
        
        local mod = 1
        if aura_env.difficultyID == 16 then
            mod = 3
        end
        aura_env.counter =(aura_env.counter  % mod) + 1
    end
    The top part marks the target of the fixate (and makes sure to not unmark in case the target already has the correct mark). The bottom part uses the difficulty we grabbed in one of the triggers and makes sure the mark gets cycled correctly. For mythic it cycles through 1 (yellow) > 2 (orange) > 3 (purple) > 1 etc. On every other difficulty it just stays with 1 (yellow), because there is only 1 fixate target.

    Just wrote this, so it is untested. If there are any problems with it, just tell me what it does/doesn't do

  3. #903

    Default

    Thank you so much for the prompt reply. I'll be testing this tomorrow on our Mythic Flamebender kill.

  4. #904

    Default

    Hi,
    My guild is progressing on Blast Furnace so i wanna make a Weakaura to track if Unit is staying in Defense Zone to warn help the tank moving them out of there.

    I am using custom LUA which for Combatlog event.

    Trigger LUA:

    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
    DefUnitCount = 0
    if message == "SPELL_AURA_APPLIED" and spellName == "Defense" then
    DefUnitCount = DefUnitCount + 1
    if DefUnitCount > 0 then
    DefUnitName = destName
    return true
    end
    end

    end

    UNtrigger LUA


    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
    DefUnitCount=0
    if message == "SPELL_AURA_REMOVED" and spellName == "Defense" then
    DefUnitCount = DefUnitCount - 1
    if DefUnitCount < 1 then
    return true
    end
    end

    end


    My pervious code (which i use a While Loop is not working), and for this one i revised it, but i didn't have a chance to test since WOW server is down.
    Can you help me check and give advice on this code.

  5. #905

    Default

    Hey Kullam,

    I found this thread and have been reading every single post from the start. I'm up to page 58 now. It's been very informative and helpful! I had no idea that WA2 could do half the things written here but I guess it makes sense looking at it as an in-game Lua wrapper vs just a timer addon, which is what I thought it was. Anyway, I've been rehauling my UI and this thread has helped immensely, so thanks!

    Anyway, I do have a quick question, maybe more like a confirmation.

    I want to write a WA to trigger on SPELL_CAST_SUCCESS. This is simple enough, but on trigger I want to have it /say something in chat/raid. The triggering spell gives a target, so that /say message should include the name of the target. Basically think of it like those raid addons that say when people drop a Jeeves and who dropped it, so I know the functionality is possible.

    But here's the problem that comes up in mind though, and this is assuming I understand how WA works correctly: My trigger will trigger when it sees the spell cast and then my display/chat message will appear. But the display code won't have any of the target information seen by the trigger function because it only passes true/false.

    Does this mean that I'll need to have my trigger function do all the work, and then just have no display and a 0 or 1 second untrigger? That is to say, grab the spell cast success target in the trigger and call the chat message api? (This is of course assuming that I can grab the target on a trigger event, which I'm not sure about).

    No need to write any code for me as I can do it myself , just wondering more about the structure.

  6. #906

    Default

    Quote Originally Posted by recycle View Post
    Hey Kullam,

    I found this thread and have been reading every single post from the start. I'm up to page 58 now. It's been very informative and helpful! I had no idea that WA2 could do half the things written here but I guess it makes sense looking at it as an in-game Lua wrapper vs just a timer addon, which is what I thought it was. Anyway, I've been rehauling my UI and this thread has helped immensely, so thanks!
    Awesome of you to say and glad to hear this thread helps out!

    Quote Originally Posted by recycle View Post
    But here's the problem that comes up in mind though, and this is assuming I understand how WA works correctly: My trigger will trigger when it sees the spell cast and then my display/chat message will appear. But the display code won't have any of the target information seen by the trigger function because it only passes true/false.
    That's correct. Unfortunately WeakAuras doesn't offer any built-in functionality to retrieve data about actors (units and the like) which may be involved in some core functionality (such as Event > Combat Log Triggers).

    Quote Originally Posted by recycle View Post
    Does this mean that I'll need to have my trigger function do all the work, and then just have no display and a 0 or 1 second untrigger? That is to say, grab the spell cast success target in the trigger and call the chat message api? (This is of course assuming that I can grab the target on a trigger event, which I'm not sure about).
    This is also correct; you'll want to perform the entirety of your action from detecting the Triggering event(s) to outputting your chat message within the Trigger: Custom Function. A zero-second duration is perfectly fine, but so long as you never actually return a value (that is, never use the return statement), the Trigger will never fire regardless.

    As for grabbing the target of your event, I'd strongly suggest checking out some of the COMBAT_LOG functions I've created. In particular the GetDestination function will allow you to easily retrieve the Destination unit for whatever relevant COMBAT_LOG events you're tracking.

    Hope that helps and good luck!

  7. #907

    Default

    Quote Originally Posted by Khab View Post
    Hi,
    My guild is progressing on Blast Furnace so i wanna make a Weakaura to track if Unit is staying in Defense Zone to warn help the tank moving them out of there.

    I am using custom LUA which for Combatlog event.

    Trigger LUA:

    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
    DefUnitCount = 0
    if message == "SPELL_AURA_APPLIED" and spellName == "Defense" then
    DefUnitCount = DefUnitCount + 1
    if DefUnitCount > 0 then
    DefUnitName = destName
    return true
    end
    end

    end

    UNtrigger LUA


    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
    DefUnitCount=0
    if message == "SPELL_AURA_REMOVED" and spellName == "Defense" then
    DefUnitCount = DefUnitCount - 1
    if DefUnitCount < 1 then
    return true
    end
    end

    end


    My pervious code (which i use a While Loop is not working), and for this one i revised it, but i didn't have a chance to test since WOW server is down.
    Can you help me check and give advice on this code.
    The immediate issue I see with your functions is that you are not using the DefUnitCount variable as you might imagine. Since you are defining the value as zero at the start of every Trigger and Untrigger call, the value is "reset" every on every single combat log event.

    It doesn't matter much for the Trigger code (since if you find a matching event you always want it to trigger anyway), but for the Untrigger it matters a great deal:

    Code:
    DefUnitCount = 0
    if message == "SPELL_AURA_REMOVED" and spellName == "Defense" then
      DefUnitCount = DefUnitCount - 1
      if DefUnitCount < 1 then
        DefUnitName = destName
        return true
    end


    If the execution of this function ever gets past your initial if...then statement, then DefUnitCount will always be less than 1 (in fact it will always be -1) since it started at zero and you subtracted 1 from it. This essentially means that in spite of your intention to track the total number of units afflicted by Defense, instead your Trigger will be hidden anytime one of those units loses Defense (even if others still have it active).

    Beyond that, I'd also suggest not utilizing global variables such as DefUnitCount. WeakAuras recently added a nice feature that allows you to store localized variables and use them in your custom code using the aura_env table.

    Additionally, I think you'll run into confusion when multiple units are gaining/losing the Defense aura since your code is only attempting to track one single unit name. I'd suggest making a table list of all afflicted units and adding/removing from that list (which again should be done within the aura_env table).

    Generally you'll want to initialize the default value of aura_env variables in the Actions > On Init: Custom Function like so:

    Code:
    aura_env.units = {}


    Now your table to hold the afflicted units is created, so you can start adding to it in your trigger (and removing units in the untrigger).

    Since multiple units can exist with the same name, you'll want to identify each unit by a unique value, which is precisely what the GUID is for. So the Trigger might look something like this:

    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
      -- Use Spell IDs instead of names when possible
      if message == "SPELL_AURA_APPLIED" and spellID == 160382 then
        -- First ensure no records exist accidentally with the same GUID
        for i = #aura_env.units, 1, -1 do
          if aura_env[i].guid == destGUID then
            tremove(aura_env.units, i)
          end
        end
        -- Now add a new record to our table with the GUID and name
        tinsert(aura_env.units, {guid = destGUID, name = destName})
      end
      -- Now determine if we SHOW the Display by checking if our unit table has any entries
      return #aura_env.units >= 1
    end


    The code is commented reasonably well, but the basic idea is to find appropriate event matches that you are looking for, ensure only a single entry in our unit list exists, then determine if the display should show based on if we have any units currently in the list.

    Untrigger is much in reverse:

    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName)
      if message == "SPELL_AURA_REMOVED" and spellID == 160382 then
        -- Check our table for a matching GUID and if found, remove the table entry
        -- When removing during a loop function, it is best to iterate in reverse to avoid skipping entries (even though we expect only a single match per iteration in this case)
        for i = #aura_env.units, 1, -1 do
          if aura_env[i].guid == destGUID then
            tremove(aura_env.units, i)
          end
        end
      end
      -- Now determine if we HIDE the Display by checking if our unit table has any entries
      return (not aura_env.units) or (#aura_env.units <= 0)
    end


    Obviously here we want to hide the Display only if there are no units in the tracking list at the time.

    The final step is to add a Display > Display Text: %c Custom Function and extract the list of affected units you've collected to show up. Something like this should suffice:

    Code:
    function()
      -- Ensure unit table has some entries
      if aura_env.units and #aura_env.units >= 1 then
        local output = ''
        -- Loop through the list and add each name to our display string
        for i,unit in pairs(aura_env.units) do
          -- We're appending the next unit name onto the existing output string, each split with a new line
          output = ('%s%s\n'):format(output, unit.name)
        end
        -- Return the aggregate output string for display
        return output
      end
      -- As a safeguard simply display nothing if no units are tracked
      return ''  
    end


    I haven't tested any of this of course but hopefully that gets you on a slightly straighter track!

  8. #908

    Default

    Quote Originally Posted by recycle View Post
    I want to write a WA to trigger on SPELL_CAST_SUCCESS. This is simple enough, but on trigger I want to have it /say something in chat/raid. The triggering spell gives a target, so that /say message should include the name of the target. Basically think of it like those raid addons that say when people drop a Jeeves and who dropped it, so I know the functionality is possible.
    If all you want is a chat msg, you don't even need to return a value to trigger the aura. From the trigger code you can just send a chat msg.

    The true/false return for the triggers are to initiate an aura to show on your screen or not. Other than that, you don't have to return a true or false and can execute whatever code you want. (this was also how the old gold mailing hack got around people who didn't understand how the custom code worked)

    Another way would be returning true on your aura when successful, then using the "OnShow" function in the actions tab to display a chat msg (which uses more of WA2 built-in UI). You would then make an "invisible" aura so nothing shows up but the chat msg displays. I do this for some spell casts like typhoon and vortex.

  9. #909

    Default

    Quote Originally Posted by Hamsda View Post
    To be honest, this sounds like a good idea and I would just contact BW and DBM authors to implement it!

    I put together an aura that should do the job though: pastebin
    It has two triggers and some extra code in the OnInit/OnShow.
    1) The OnInit is just there to init the variables we need:
    Code:
    aura_env.counter = 1
    aura_env.dest = nil
    aura_env.difficultyID = nil
    2) The first trigger is the one handling the application of the Fixate debuff by the wolves and saves the target. Listens to COMBAT_LOG_EVENT_UNFILTERED.
    Trigger:
    Code:
    function(event, ...)
        if select(2, ...) == "SPELL_AURA_APPLIED" and select(12, ...) == 154952 then
            aura_env.dest = select(9, ...)
            return true
        end
        return false
    end
    Untrigger:
    Code:
    function()
        aura_env.dest = nil
        return true
    end
    3) The second trigger is for the entire Flamebender encounter and is basically just there to grab the difficulty and reset the mark counter in the case of a wipe. Listens to ENCOUNTER_START, ENCOUNTER_END.
    Trigger:
    Code:
    function(event, encounterID, encounterName, difficultyID, raidSize)
        if event == "ENCOUNTER_START" and encounterID == 1689 then
            aura_env.difficultyID = difficultyID
            return true
        end
        return false
    end
    Untrigger:
    Code:
    function(event, encounterID, encounterName, difficultyID, raidSize)
        if event == "ENCOUNTER_END" and encounterID == 1689 then
            aura_env.difficultyID = nil
            aura_env.counter = 1
            return true
        end
        return false
    end
    4) The OnShow is where the actual marking happens:
    Code:
    if aura_env.dest and aura_env.counter then
        local icon = GetRaidTargetIndex(aura_env.dest)
        if not (icon and icon == aura_env.counter) then
            SetRaidTarget(aura_env.dest, aura_env.counter)
        end
        
        local mod = 1
        if aura_env.difficultyID == 16 then
            mod = 3
        end
        aura_env.counter =(aura_env.counter  % mod) + 1
    end
    The top part marks the target of the fixate (and makes sure to not unmark in case the target already has the correct mark). The bottom part uses the difficulty we grabbed in one of the triggers and makes sure the mark gets cycled correctly. For mythic it cycles through 1 (yellow) > 2 (orange) > 3 (purple) > 1 etc. On every other difficulty it just stays with 1 (yellow), because there is only 1 fixate target.

    Just wrote this, so it is untested. If there are any problems with it, just tell me what it does/doesn't do
    So I finally got to try this out on our Flamebender kill tonight and I ran into 1 issue with it. On the very first set of fixates it does not mark. It picked up the rest of them for the rest of the fight though. We had 3 wipes and it was the same on all 3 wipes and the kill. Other than that it was fantastic and exactly what I had hoped for. I appreciate it very much.

  10. #910

    Default

    Yeah on our kill on Wednesday I didn't pay too much attention to it because I was offspec shadow, but I had a look at the logs afterwards and it didn't seem quite right. I'll have to have a look at it next ID as a healer and see if I can figure out where the problem lies.

Tags for this Thread

Posting Permissions

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