1. #1

    Healing Tide Totem WA string

    Trying to create a raid leading WA string for healing tide totem to display when a totem is down, the duration on it and the caster's name. I've got 2 out of 3 of them trying two different methods.

    The one I think which has a simpler solution is:

    Trigger
    type: event
    event: combat log
    message > cast success
    spell name: Healing Tide Totem
    hide > 10 seconds

    Now this alone will trigger , show duration, and untrigger after duration expires but does not show name, so creating a custom display text is required I assume. Here is what I have, that is not working:


    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 == "Healing Tide Totem" then
    local name = sourceName
    return name
    end
    end
    return "Unknown"
    end


    Each time it returns unknown so I assume it is not meeting the requirements of the if statement?

  2. #2
    Pretty sure there was a thread some times ago with the exact same request for Stormlash totem.
    Should be easy to adapt to HTT is you can find it

  3. #3
    Quote Originally Posted by Kaytemoss View Post
    Pretty sure there was a thread some times ago with the exact same request for Stormlash totem.
    Should be easy to adapt to HTT is you can find it
    I'm using the thread as a reference however the solution was done using a trigger for auras not spell cast success. Unfortunately healing tide totem does not give an aura.

  4. #4

  5. #5
    Custom text functions do not have trigger event parameters passed to them. The parameters are provided by WeakAuras with information about the icon.

    You assign a global variable in the trigger function, then either:
    a. use the value of that variable in the custom Name Info function and use %n in the text field, or
    b. use the value of that variable in the custom text function.

  6. #6
    Quote Originally Posted by Kaytemoss View Post
    Doesn't work, healing tide is not an aura.



    Quote Originally Posted by pnutbutter View Post
    Custom text functions do not have trigger event parameters passed to them. The parameters are provided by WeakAuras with information about the icon.

    You assign a global variable in the trigger function, then either:
    a. use the value of that variable in the custom Name Info function and use %n in the text field, or
    b. use the value of that variable in the custom text function.
    This is what I thought but wasn't having success either way. Now this leads me to my other question. I am not using a customer trigger, I am simply using an event trigger for spell cast success. Now I have another string I was working on in which I have the name, but not the time remaining and I cannot seem to figure out how to untrigger the event.

    custom event type status
    check on events: COMBAT_LOG_EVENT_UNFILTER

    trigger>

    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 == "Healing Tide Totem" then
    name = sourceName
    time = timestamp
    return true
    end
    end
    end


    name>

    function()
    return name
    end

  7. #7
    yeah, if you want the name of the shaman, you'll have to use a custom trigger.

    for the duration and untrigger, don't do them custom, just do Timed and enter 10.

  8. #8
    Quote Originally Posted by pnutbutter View Post
    yeah, if you want the name of the shaman, you'll have to use a custom trigger.

    for the duration and untrigger, don't do them custom, just do Timed and enter 10.

    I'm confused how I'm supposed to make this part custom and part configed fixed time? Do I make two triggers?


    edit:

    I think I got the duration down actually, using this:

    function()
    return 10, GetTime()+10
    end


    And nothing in the untrigger field and it seems to be working locally, need to test on another character.

  9. #9

  10. #10
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    Would be awesome if WA had local variables inside an aura , remember to not call it name = spellName but choose a more distinctive name that won't interfere such as waHTName (you get the drill)

    Unless a duration is different depending on variables such as glyphs or what not you always want to use the Timed function instead.

    Code:
    deeOeaGirsxssvnkreNseQzPuULii7cbgMuXXqultKWZebAAIkxtsv2gfr(MiOoNiK7HGoOOOfsr6HqyIquxuszJsL(OiLrks1jPIwjf1mffUPis7us(jfHHkIYsvQ8uHPIIRcr2QiG5ks0Ej9xPQbdomQwSsv9ykmzLCzIntf(mvA0iYPP0RvQYSL42sz3i9BQA4i0YrPNd10vCDiTDrvFxsLXtruNxuA9IOA)QwjRmA00yPXsz0yyTUUcRYOXcLLpwpvdYK1Wafp(wpj7s0ySnzPXKLOOHbkE8nnmqXJV1pzjkAi5f6ObMOukv8MOr6cVyPUhySl5aJFKMgy09L8cDcuhoSMSg9iYmy6dKqGOweAi5f6Obcs85qsfmM7kAGsL8cD0ySnzPHKxOdwdeMiPMMjtFgMiT(AjqTkMEKQ66mdMA7QHSggO4X3Q4nrdhOuJX6PjjX38HdhoWkdkl9qD8DiqMYBYnl0LggO4X30Wbk1ySEAsK8cD2om2MGhEJ42HMGXCxz7aj7sqWXJWUDa7rznK0qYjYBhWEuwdPI3KTdypkRH0TWDXBhWEuwdzh3U6w4U4TdlbpPHKtK3oSe8uXBY2HLGNUfUlE7WsWZoUD1TWDXBhiGacs8Hd38HdhoyDCOjym3voqiHhsnswTmYOhrMbtFGece1Ii1ddjHEZhoC4WHdhou8g8YbmrPuCU2oGjkLsfVjBhWeLsjmi59LdeEGaci4MpC4WHdhoCW64aMOukv8MCGqcpKA6cVyPUhySl5aJFKwQhgsc9WHd38HdhoC4WHdhoC4qD8DiqMYBYbcpG9OSgsfVj38HdhoC4WHdhoC4aRmOS0ddlQCZhoC4WHdhoi01nF4WHdcDDZcDPbkw6rP2rnvduS0JjkLsfVjQPAq5nbRmAfzn2XlLSwQ7beSz1rhnC4PJgzAAxnijwxsJwLRJgfpFPmAW6lIYOrdTmwLrhD0afl9ujVWQ7RJgo80jSjx0kY50yzXel8SXWn2dRr9PAWkUwpLjlrrdRHNQbE4g7HtM3shn25mT0z0apCJ9Wi80HBPnHoAycKycNixtJK79nTB96KlxNeKSj1jh5uKOeorPqDKq1lNg2LgPl8IL6EGXUKdm(rAAuNDnK0QCD0GI2yyTUUclwRiRXYIjw4zDA4PA4KocRdUHKsNgEkoL89Tf7KThtI340EscVyPUJDjAy49LLVoQAQoAG1GLChnYRvKZrUJoQca
    Last edited by suprep; 2013-12-02 at 12:24 PM.
    Retired in WoD

  11. #11
    Quote Originally Posted by suprep View Post
    Would be awesome if WA had local variables inside an aura , remember to not call it name = spellName but choose a more distinctive name that won't interfere such as waHTName (you get the drill)

    Unless a duration is different depending on variables such as glyphs or what not you always want to use the Timed function instead.

    Code:
    deeOeaGirsxssvnkreNseQzPuULii7cbgMuXXqultKWZebAAIkxtsv2gfr(MiOoNiK7HGoOOOfsr6HqyIquxuszJsL(OiLrks1jPIwjf1mffUP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89Tf7KThtI340EscVyPUJDjAy49LLVoQAQoAG1GLChnYRvKZrUJoQca

    Thanks for the help pnut and suprep, I'll go back and modify all my strings to have new variables for the sourcename. I've been having issues with the UI however, specifically when monitoring healing in skada and using my WA strings for raid-wide cooldowns both defensive and healing. The UI seems to have a major issue with the return of the value "nil". I think it bombs out skada and skada just stops working. Also some weird memory allocation block too big. Here is the code I'm using that I believe is the cause of the issue:

    Code:
    ["message"] = "<string>:\"return function()...\":4: attempt to compare number with nil",
    			["time"] = "2013/12/02 18:58:25",
    			["locals"] = "id = \"RC_Zen Meditation\"\ntriggernum = 0\ndata = <table> {\n nameFunc = <function> defined return function()\n    local caster = select(8, UnitBuff(\"player\", \"Zen Meditation\"))\n    if caster then\n        local name = UnitName(caster)\n        return name\n    end\n    return \"Unknown\"\nend:1\n untrigger = <function> defined return function(_, unitID)\n    if unitID == \"player\" then\n        local buff = UnitBuff(\"player\", \"Zen Meditation\")\n        return buff == nil\n    end\nend:1\n durationFunc = <function> defined return function()\n    local caster = select(8, UnitBuff(\"player\", \"Zen Meditation\"))\n    if caster then\n        local name = UnitName(caster)\n        if WA_SB_Caster_List and WA_SB_Caster_List[name] then\n            return 8, WA_SB_Caster_List[name]+8.1 -- +0.1 for the delay\n        else\n            WA_SB_Caster_List = WA_SB_Caster_List or {}\n            WA_SB_Caster_List[name]=GetTime()-0.1\n            return 8, GetTime()+8\n        end\n    end\n    return 0, math.huge\nend:1\n stacksFunc = <function> defined return function()\n    local charges\n    charges = GetSpellCharges(\"Zen Meditation\")\n    if charges >= 1 then\n        return charges\n    end\nend\n\n\n\n\n\n\n\n\n\n:1\n icon = true\n expiredHideFunc = false\n unevent = \"auto\"\n trigger = <function> defined return function(_, unitID)\n    if unitID == \"player\" then\n        local buff = UnitBuff(\"player\", \"Zen Meditation\")\n        return buff ~= nil\n    end\nend:1\n numAdditionalTriggers = 1\n event = \"Alternate Power\"\n subevent = false\n region = <unnamed> {\n }\n events = <table> {\n }\n cooldown = true\n load = <function> defined return function(event, combat, name, class, spec, level, zone, size, difficulty, role)\nlocal never = false\nif((class==\"MONK\" or class==\"PALADIN\") and (size==\"flexible\" or size==\"party\" or size==\"scenario\" or size==\"twentyfive\" or size==\"ten\" or size==\"arena\" or size==\"fortyman\" or size==\"pvp\")) then\nreturn true else return false end end:1\n}\nending = true\ntrigger = <table> {\n stack_info = \"count\"\n autoclone = true\n spellId = \"97463\"\n groupclone = false\n duration = \"10\"\n name_info = \"players\"\n use_unit = true\n subeventPrefix = \"SPELL\"\n unit = \"player\"\n debuffType = \"HELPFUL\"\n custom = \"function(_, unitID)\n    if unitID == \"player\" then\n        local buff = UnitBuff(\"player\", \"Zen Meditation\")\n        return buff ~= nil\n    end\nend\"\n custom_hide = \"custom\"\n custom_type = \"status\"\n name_operator = \"==\"\n name = \"Rallying Cry\"\n tooltip_operator = \"==\"\n use_spellId = true\n tooltip = \"Temporarily grants you and all party or raid members within 30 yards 20% of maximum health for 10 sec.  After the effect expires, the health is lost.\"\n event = \"Alternate Power\"\n customStacks = \"function()\n    local charges\n    charges = GetSpellCharges(\"Zen Meditation\")\n    if charges >= 1 then\n        return charges\n    end\nend\n\n\n\n\n\n\n\n\n\n\"\n customDuration = \"function()\n    local caster = select(8, UnitBuff(\"player\", \"Zen Meditation\"))\n    if caster then\n        local name = UnitName(caster)\n        if WA_SB_Caster_List and WA_SB_Caster_List[name] then\n            return 8, WA_SB_Caster_List[name]+8.1 -- +0.1 for the delay\n        else\n            WA_SB_Caster_List = WA_SB_Caster_List or {}\n            WA_SB_Caster_List[name]=GetTime()-0.1\n            return 8, GetTime()+8\n        end\n    end\n    return 0, math.huge\nend\"\n customName = \"function()\n    local caster = select(8, UnitBuff(\"player\", \"Zen Meditation\"))\n    if caster then\n        local name = UnitName(caster)\n        return name\n    end\n    return \"Unknown\"\nend\"\n events = \"UNIT_AURA\"\n subeventSuffix = \"_CAST_START\"\n check = \"event\"\n type = \"custom\"\n unevent = \"auto\"\n names = <table> {\n }\n}\n(*temporary) = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:226\n(*temporary) = <unnamed> {\n 0 = <userdata>\n DisableTrigger = <function> defined @Interface\\AddOns\\WeakAuras\\WeakAuras.lua:3717\n values = <table> {\n }\n frameId = \"rc_zen_meditation\"\n Color = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:173\n duration = 0\n Expand = <function> defined @Interface\\AddOns\\WeakAuras\\WeakAuras.lua:3628\n expirationTime",
    			["stack"] = "[string \"return function()WeakAuras.lua:1871: in function \"SetEventDynamics\"\nWeakAuras\\WeakAuras-2.0.lua:1943: in function \"EndEvent\"\nWeakAuras\\WeakAuras-2.0.lua:1787: in function \"ScanEvents\"\nWeakAuras\\WeakAuras-2.0.lua:1764: in function <WeakAuras\\WeakAuras.lua:1718>",
    			["session"] = 12,
    			["counter"] = 1049,
    		}, -- [2]
    		{
    			["message"] = "memory allocation error: block too big",
    			["time"] = "2013/12/02 19:36:20",
    			["locals"] = "",
    			["stack"] = "",
    			["session"] = 13,
    			["counter"] = 2,
    		}, -- [3]
    		{
    			["message"] = "<string>:\"return function(...)...\":19: attempt to concatenate a nil value",
    			["time"] = "2013/12/02 16:55:13",
    			["locals"] = "customTextFunc = <function> defined return function(...)\n    local GetAuraSourceName = function(aura)\n        local RAID_SIZE = 25\n        local auraName = aura\n        if type(aura) == 'number' then \n            auraName = GetSpellInfo(aura) \n        end\n        for i=1,RAID_SIZE do\n            local unitCaster = select(8, UnitAura('raid'..i, auraName))\n            if unitCaster and UnitExists(unitCaster) then\n                return UnitName(unitCaster) \n            end\n        end    \n        local unitCaster = select(8, UnitAura('player', auraName))\n        if unitCaster and UnitExists(unitCaster) then\n            return UnitName(unitCaster)\n        end\n    end\n    return \"\\n\" .. GetAuraSourceName(select(5, ...)).. \"\\n\"\nend:1\nregion = <unnamed> {\n 0 = <userdata>\n values = <table> {\n }\n UpdateCustomText = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:209\n Color = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:173\n duration = 12\n Expand = <function> defined @Interface\\AddOns\\WeakAuras\\WeakAuras.lua:3628\n expirationTime = 818434.48799983\n SetDurationInfo = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:380\n stacks = <unnamed> {\n }\n SetIcon = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:235\n GetColor = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:184\n trigger_count = 0\n icon = <unnamed> {\n }\n color_g = 1\n color_b = 1\n triggers = <table> {\n }\n backdrop = <unnamed> {\n }\n color_r = 1\n Collapse = <function> defined @Interface\\AddOns\\WeakAuras\\WeakAuras.lua:3620\n SetName = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:251\n Scale = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:335\n color_a = 1\n SetStacks = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:226\n cooldown = WeakAurasCooldownrc_life_cocoon {\n }\n frameId = \"rc_life_cocoon\"\n}\nvalues = <table> {\n stacks = 1\n name = \"Life Cocoon\"\n progress = \"4.1\"\n duration = \"12.0\"\n icon = \"|TInterface\\Icons\\ability_monk_chicocoon:12:12:0:0:64:64:4:60:4:60|t\"\n}\nUpdateText = <function> defined @Interface\\AddOns\\WeakAuras\\RegionTypes\\icon.lua:192\n",
    			["stack"] = "[string \"return function(RegionTypes\\icon.lua:210: in function \"UpdateCustomText\"\nWeakAuras\\WeakAuras-2.0.lua:4931: in function <WeakAuras\\WeakAuras.lua:4927>",
    			["session"] = 21,
    			["counter"] = 238,
    		}, -- [4]

    I'm not really sure how to fix either.

  12. #12
    I don't know about the memory issue, but the attempt to compare number with nil is a common bug when learning Lua. I'll show you the fix for the first issue I found in the functions; hopefully you get the idea and can fix it anywhere else (kinda hard for me to read when it's on one line).

    you have something like
    Code:
    local charges=GetSpellCharges("someSpell")
    return charges>1
    but if GetSpellCharges ever returns nil, you're then asking Lua to evaluate nil>1, which it can't do. Instead you do
    Code:
    local charges=GetSpellCharges("someSpell") or 0
    return charges>1
    so that if GetSpellCharges returns nil the local variable will instead be assigned to 0

Posting Permissions

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