WeakAuras

Call to Arms

  • 6 posts
    #1 Sep 24, 2011 at 09:00 UTC - 0 likes

    Quick and easy, crate a new display and use following trigger:

    • Type: Custom -> Event
    • Events: LFG_UPDATE_RANDOM_INFO
    • Custom (show) code:
    function()
      -- Returns
      local eligible, forTank, forHealer, forDamage, itemCount, money, xp
    
    
      -- Cataclysm Dungeons
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(301, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Cataclysm Dungeons]
      if forTank then return true end
    
      -- Remove this if you don't won't to know about HEALER rewards [Cataclysm Dungeons]
      if forHealer then return true end
    
      -- Remove this if you don't won't to know about DD rewards [Cataclysm Dungeons]
      if forDamage then return true end
    
    
      -- Rise of Zandalari
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Rise of Zandalari]
      if forTank then return true end
    
      -- Remove this if you don't won't to know about HEALER rewards [Rise of Zandalari]
      if forHealer then return true end
    
      -- Remove this if you don't won't to know about DD rewards [Rise of Zandalari]
      if forDamage then return true end
    end
    

    Tank example:

    function()
      -- Returns
      local eligible, forTank, forHealer, forDamage, itemCount, money, xp
    
      -- Cataclysm Dungeons
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(301, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Cataclysm Dungeons]
      if forTank then return true end
    
      -- Rise of Zandalari
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Rise of Zandalari]
      if forTank then return true end
    end
    
    • Custom (hide) code: (Changed from timed to custom)
    function()
      -- Cataclysm + Rise of the Zandalari Dungeons
      local eligibleCD,      forTankCD,     forHealerCD,     forDamageCD,      itemCountCD,      moneyCD,     xpCD = GetLFGRoleShortageRewards(301, 1)
      local eligibleRotZD, forTankRotZD, forHealerRotZD, forDamageRotZD, itemCountRotZD, moneyRotZD, xpRotZD = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove any expression (not X and) that you don't want to be informed for
      if     not forTankCD     and not forHealerCD      and not forDamageCD 
      and not forTankRotZD and not forHealerRotZD and not forDamageRotZD
      then return true end
    end
    

    Tank example:

    function()
      -- Cataclysm + Rise of the Zandalari Dungeons
      local eligibleCD,      forTankCD,     forHealerCD,     forDamageCD,      itemCountCD,      moneyCD,     xpCD = GetLFGRoleShortageRewards(301, 1)
      local eligibleRotZD, forTankRotZD, forHealerRotZD, forDamageRotZD, itemCountRotZD, moneyRotZD, xpRotZD = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove any expression (not X and) that you don't want to be informed for
      if     not forTankCD
      and not forTankRotZD
      then return true end
    end
    

    Plus, if you are using a text display you can use this custom function to display current CTA roles:

    • Custom text code:
    function()
      -- Returns
      local eligible, forTank, forHealer, forDamage, itemCount, money, xp
    
       -- You may edit this
      local text = "CTA roles: "
    
    
      -- Cataclysm Dungeons
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(301, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Cataclysm Dungeons] (Text max be edited)
      if forTank then text = text .. "Tanks [Cataclysm] " end
    
      -- Remove this if you don't won't to know about HEALER rewards [Cataclysm Dungeons] (Text max be edited)
      if forHealer then text = text .. "Healers [Cataclysm] "end
    
      -- Remove this if you don't won't to know about DD rewards [Cataclysm Dungeons] (Text max be edited)
      if forDamage then text = text .. "Damage [Cataclysm] " end
    
    
      -- Rise of Zandalari
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Rise of Zandalari] (Text max be edited)
      if forTank then text = text .. "Tanks [Zandalari] " end
    
      -- Remove this if you don't won't to know about HEALER rewards [Rise of Zandalari] (Text max be edited)
      if forHealer then text = text .. "Healer [Zandalari] " end
    
      -- Remove this if you don't won't to know about DD rewards [Rise of Zandalari] (Text max be edited)
      if forDamage then text = text .. "Damage [Zandalari] " end
    
      -- Done
      return text
    end
    

    Tank example:

    function()
      -- Returns
      local eligible, forTank, forHealer, forDamage, itemCount, money, xp
    
       -- You may edit this
      local text = "CTA roles: "
    
      -- Cataclysm Dungeons
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(301, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Cataclysm Dungeons] (Text max be edited)
      if forTank then text = text .. "Tanks [Cataclysm] " end
    
      -- Rise of Zandalari
      eligible, forTank, forHealer, forDamage, itemCount, money, xp = GetLFGRoleShortageRewards(341, 1)
    
      -- Remove this if you don't won't to know about TANK rewards [Rise of Zandalari] (Text max be edited)
      if forTank then text = text .. "Tanks [Zandalari] " end
    
      -- Done
      return text
    end
    
    Last edited Sep 24, 2011 by CommanderSirow
    #2 Sep 25, 2011 at 01:38 UTC - 0 likes

    Thank you so much. It all works, kinda. I toyed with it to the point that i kinda even understand what it means.

    The "kinda" comes down to the deciding factor that this has a ways to go for it to be any better than just looking at the dungeon menu every few minutes.

    The only time that the Call to Arms is updated on the client side is when you receive LFG_UPDATE_RANDOM_INFO in the event log. The only way I have found to get LFG_UPDATE_RANDOM_INFO is to open the Dungeon Finder. At that point your already looking at the CTA and don't need a WeakAuras trigger :(

    I am in completely way over my head on this, but I am going to keep trying to find a way to make this work. I just have to find a way to queue for LFG_UPDATE_RANDOM_INFO every 20 - 30 sec automatically.

    Thank you for everything you have done.

    EDIT: Maybe this will be my first attempt at an addon. Small and sweet. Its just going request LFG_UPDATE_RANDOM_INFO every so many seconds. lol

    Last edited Sep 25, 2011 by Ruid00
    #3 Sep 25, 2011 at 10:44 UTC - 0 likes

    After some reading, it seems like LFG_UPDATE_RANDOM_INFO is only fired when the user is actually looking at the LFG-Tool. *sad face blizzard* Thus, one needs to do (throttled) updating.

    Switch from "Events" to "Every Frame" and replace custom (show) and custom (hide) trigger:

    function()
    

    with

    function(elapsed)
      -- Update every 10 seconds
      if not WA_CTA_last or elapsed > WA_CTA_last + 10 then
        WA_CTA_last = elapsed
    

    Also replace the very last

    end
    

    with

      end
    end
    
    #4 Sep 25, 2011 at 21:25 UTC - 0 likes

    3+ hours of reading Wowpedia and tinkering with WoWUi Designer last night. I learned that wow is event based, you have to define functions, once they are defined you have to call upon them, and how to make an addon not show "out of date".

    I was so relieved when I checked this and seen that you found an easy fix. Unfortunately I still cant get it to work.

    I have a friend rushing me at the moment calling me a slow poke trying to do quests. Tonight after she goes to bed I will come back and give it another shot.

    #5 Sep 26, 2011 at 13:31 UTC - 0 likes

    if

    function(elapsed)
      -- Update every 10 seconds
      if not WA_CTA_last or elapsed > WA_CTA_last + 10 then
        WA_CTA_last = elapsed
    

    does not work, try

    function(event, elapsed)
      -- Update every 10 seconds
      if not WA_CTA_last or elapsed > WA_CTA_last + 10 then
        WA_CTA_last = elapsed
    

    If that doesn't work either, try this :D

    function()
      -- Update every 10 seconds
      local now = GetTime()
      if not WA_CTA_last or now > WA_CTA_last + 10 then
        WA_CTA_last = now
    

    (Using GetTime() instead of elapsed which SHOULD be passed on by OnUpdate to WA might be a bit slower, though not noticeable for one trigger)

    #6 Oct 04, 2011 at 18:06 UTC - 0 likes

    Well, thanks for all your help. I never could get it working right. Its probably just my lack of understanding on the subject. I have just thrown this on the back burner for a while.

  • 6 posts

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