1. #1
    Deleted

    WA moving CD Timer or enhacing Text on Symbols

    Hi There,

    as I am using Weakauras 2 since 6.02 and I got some questions, where you might help me.

    At first I'd like to position Symbols in a dynamic group. Those Symbols shall show me a stack counter on the Icon and a timer for the remaining time under the icon. (So things will look like a normla Blizzard Buff/Debuff)

    Setting this up with the CD timer in the middle of the icon is np.... that's the default position, and under the icon I can put the text %s to see stacks...
    Well this works fine.... I just want it the other way round xD

    So Question:
    How do I move the CD timer? Cause than I could place the stack counting text on the Icon....
    OR: Is there a way to put different lines in the text for the icon? e.g. "%s 'return' %t"?
    How does the %c work here? Maybe this helps me....

    I already tried a "workaround" And put Symbol + Text in a Group. This works.... But I can't place a group into another dynamic group..... Or did I do sth wrong?

    So the last option would be to put symbols and texts into a dynamic group itself.... but havent tried if this works.... but this would be honestly too much work.... I'd rather stick with my current solution with stacks below and time on the icon....

    Thanks in advance,
    Atronach

  2. #2
    Deleted
    noone got a clue or any ideo of this?

  3. #3
    Deleted
    After reading some info on lua and api...

    I wanted to use %c in the textfield with this function:

    function ()
    local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId
    = UnitAura("player", "Arcane Charge")
    if count then
    return string.format([[%f
    %f]],
    count,
    expirationTime)
    else
    return 0
    end
    end

    (well didn't use a comma here, but the code itself didn't show any more errors after some corrections.....)
    The Probelm is..... it doesn't work.... every variabel is nil. Am I using the "UnitAura" wrong?
    Thanks for any Info or tips and tricks to learn this functions better

  4. #4
    Quote Originally Posted by LI2Atronach View Post
    How do I move the CD timer? Cause than I could place the stack counting text on the Icon....
    OR: Is there a way to put different lines in the text for the icon? e.g. "%s 'return' %t"?

    I already tried a "workaround" And put Symbol + Text in a Group. This works.... But I can't place a group into another dynamic group..... Or did I do sth wrong?

    So the last option would be to put symbols and texts into a dynamic group itself.... but havent tried if this works.... but this would be honestly too much work.... I'd rather stick with my current solution with stacks below and time on the icon....
    So none of those work unfortunately, there's no way to have multiple texts on one icon, nor any way to insert newlines. Nor does WeakAuras support nested groups.
    Now what does work is using a group of icon + text, but you can't put that in a another group.

    The code you posted didn't work, because "Arcane Charge" is a debuff and UnitAura by default checks only buffs. But there's a far simpler way to write this custom text. WeakAuras calls the custom text function with lots of interesting values and we only need to extract the right ones: Try this custom text:

    function(_, _, remainingTime, _, _, _, stacks)
    return tostring(remainingTime) .. "\n" .. tostring(stacks)
    end

  5. #5
    Deleted
    Quote Originally Posted by InfusOnWoW View Post
    WeakAuras calls the custom text function with lots of interesting values and we only need to extract the right ones
    This. Where can i find what values weakauras hands over to the function on which event? Like in your example, how do i know that remainingTime is the 3rd value?

  6. #6
    Quote Originally Posted by cromage View Post
    This. Where can i find what values weakauras hands over to the function on which event? Like in your example, how do i know that remainingTime is the 3rd value?
    It might be documented. I did read the source for that though.

    This is the call:
    Code:
    customTextFunc(region.expirationTime, region.duration, values.progress, values.duration, values.name, values.icon, values.stacks);
    Last edited by InfusOnWoW; 2014-12-25 at 09:13 AM.

  7. #7
    Deleted
    I see. As far as i understand that's the parameters for custom text display on the "Display"-tab.

    Now i have more questions than before and i hope you or someone else can answer them.

    let's assume i have a text with the custom function in Display on trigger update

    • DISPLAY
      • custom function: function() return DISPLAY_INFO end

    What is the correct custom trigger function if i want to show all information (from that event?!) that get handed over to the function?

    • TRIGGER
      • Trigger 1
        • Type: Custom
        • Event Type: Event
        • Event: UNIT_AURA
        • Custom Trigger: function (...) DISPLAY_INFO = unpack(args) end

    But i only get the error "bad argument (table expected, got nil).

  8. #8
    It's
    Code:
    arg
    and not args. Also you are just assigning the first result of unpack to DISPLAY_INFO.

  9. #9
    Quote Originally Posted by InfusOnWoW View Post
    It's
    Code:
    arg
    and not args. Also you are just assigning the first result of unpack to DISPLAY_INFO.
    Modern lua style would be:

    Code:
    function(...) THIS_IS_WRONG=unpack(...) end
    ...but Infus is right, and what you want is something closer to `return unpack(...)`, except that returns multiple values and WA will ignore all but the first, so you probably really want something akin to...

    Code:
    function(...) return table.concat({...}, ", ") end
    NB: table.concat takes a table as the first argument, so you need to use `{...}` rather than just `...` so that it passes as a table rather than unpacking implicitly.

    PS: http://www.lua.org/start.html -- half an hour reading the "how to program in lua" stuff will save you days of struggle and annoyance trying to guess how this all works, and waiting on forums to give you the answers.

Posting Permissions

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