1. #1

    [WA] Changing progress bar starting point

    Hi all,

    I use a group of progress bars to track my main cooldowns when I dps on my monk, with the bar filling up as the ability cools down. It works well for me! But there's just one detail I can't figure out how to get right.

    I would like for all of the bars to visually progress at the same rate, while being the same length, even though the cds are different for each ability. Or put another way, the bars should

    1. Not appear when the cd has more than 15 seconds left (This is done).
    2. Start filling from empty when the cd is at 15 seconds (can't figure out how to do this).

    A special case of 2: For rising sun kick, which has a 10sec cd, the bar should immediately appear to be 1/3 full. I just want all of the bars to be scaled as if the cd is 15 seconds.

    Any help is appreciated!

  2. #2
    Deleted
    I can provide you with a template. Duplicate it and change its settings in the "Actions - OnInit" field.

    Code:
    d0JziaGAIQODPGxJizFeK0mvihgYSrPrbGBkPuUQKk3wIopb1orr7LYUHA)IFIc(ls(nroTIgQKQgSQHlHoOeCkfQJbsDoIQQfkPuTujLSyePwoPwKK4PkTmcINJWeretfOjJutxQlsGxrqkxMQRtYgjQcFgeBgrTDc9rIQYSaOPruL(kizKevEOK0OjknEuOtkP4wefxJGe3dqRevpgudJGuTbTbABPT02sBG2oHLWgPTLSeULhSiie2YqDGJQHPaBzLq0gOTnI1XTbABPITNgO1wBl9Km5jSITf2aTTuX2td0ARTvlX6gOTLk2EAGwBTTffl2iwh3gOTLk2EAGwBTTKrW9ucBG2wQy7PbAT12QrWUbABPITNgO1wBTTAhYucdkCr3wKsJinsBl9KqEQWW9u0TfXYARc36jeiU2aTfwr0sL2swHH7Pegax0XnGineOhhEEEEU2BLgN7IoUZbcmVIC1qIakMmavLCeMohPHaDoqG5iLgr5yXHjD4oMo8Wdp8Wdp8Wdp8WdpCRTfb3trhupHaX11MeTBmH2w6jrrwKWGoJ9iNCBBUTTEcbIRnqBBHl62cRiAPsBvyx0XTT9S0PT1fDCtyBDmRbKARxWOruvlSGuBDvRkqajcibW6ywdi1wVGrJQwybPQkxbMmfmIAblulqax5yakkMmafGYvdjcOyYau2sR0OEkHTv(T1fDCBBvzrDET5eeiiUTWkIwQKeLg1tjSTHhE4HhE42cRiAPsBjRWW9ucdGl64gqKgc0asu0zzhhEEEE(KCoaUOJ7CGaZRuhZAaP26fmAu1cli1wx1QceqIasQKlPZDrh35abMxPoM1asT1ly0OQfwqQQYvGjtbJOwWc1cSY4CeMohPHaDoqG5vkYIe21vYry6CIIolBoqG5iLgr5yXbIIolBElRJdppppppppNvcgXM75aZrknIYXI5YitUQOiIv55WiwwsJGjvozfo88888888CFGOr6ohyU85n4S0byC455555555vPaNLUEOa521a4dW0aswHH7PegGX5q5isvqPredlmclq0XnbavKRgseqXKbOQaOpmPhN7y6XHNNNNNNNNpjNJuAeLJfhGPZfQ5iLgr5yXHseJ5TSoop8888888888888QuGZsxpuGC7Aa8by6CzY9HseJaMtwHH7PegGX5q5isvqPredlmclq0Xnbavw5yakkMmavfa9Hj94Chtpo88888888CNLWdppppppppppppx7TsJZBTYdpppppppp3X0HNNNN7Se(KCUl64ohiW8kRCmafftgGQsElRJdppppppppx7TsJZrAiqNdeyosPruowCyshEEEEUJPd3X0HhE4HhE4HhE4HhE4HhE4HhE4HhUTWkIwQKQfUOBRl642wyzDyszRl642wyfrlvsj7K2Tfwr0sLwBlcUNsycd02jE2gOT0suWkIwQ0QDBHveTuPTiLgr5yXby6CG5YFUmYKdtNlroNOOZYgosPruowCOeXyoWCOfk5YitEjIXCy6WrknIYXIdefDw2CG5vQ3XimSxjCKsJOCS4aTZ2OCG5iLgr5yXHseJ5YKJuAeLJfhGPdhP0ikhloq0iDNdmxOBT12spjkYIeg0zSR1eISTT52IOPN9ucJyPA9ecextyGgtOnqBB9ecexBG2cRiAPssuAupLW2swHH7PegGXHNNNNR9wPX55iLgr5yXbANTr5cTC5ZBWzPdW4CzYrknIYXIdens3aMJuAeLJfhkrmcyERvE4oMo8Wdp8Wd32w4IUTWkIwQ0wyfrlvAlzfgUNsyaghEEEEU2BLgN3ALhUJPdp8Wdp8WdpCBjuK2fDCVkYKNmAlv1cli1cwOwG2clRdtkBvfPrTBlSIOLkPAHl62s0OwryRl642w5CeBlRTeks7IoURx7KNmA7wVGrJS2wfU1tiqCTbAT1wB7K22cfkKxvr0sL5KO0OEkHZRsITyvjOEcbIRjmMcXABjSvidczqidYRTIgtOLxHaT1Mba


    the following one doesn't hide when (cd > 15):
    Code:
    dSJfgaGAGIAxiLxduYmjOzdXHH6MavAusc3gL(mq2jLyVQ2nI9R8tjr1Wak0Vb15LunuKQgSudhKoiLYPOu1XOu5CaLAHafzPavTyKkwUGhsipLQhdPNdyIsktvIjJIPt6IuWRKeLll66OAJivQtl0MPK2of9rKkzwssMgqfltsQrkjYIarJManEq4Kui3Ic11ak4EeQvs0vjG)IKVDVCN9oZDMxUBfMO0ncgeW9kxGIqJSy4ocmM5L7kgjj6l3z5iA8LRxVZeTAnIYr06VCNLJOXxUE9EagjF5olhrJVC96DOMqvmss0xUZYr04lxVEpGrZxUZYr04lxVE3kgvJWKxUZYr04lxVE9EibfHjL6qZ7yEathC4oteamZjOA0mVJrqUZjAiccugE5okhqHzVp5Kto5Kto5Kto5Kto517yunAMLqeeOmaUWm5Ty3DMiaueC9scHkmTQ3xFxdrqGYWl3r5akmlLGrM8UgztM7ADO5DuoGcZENHhWAeMChSVNMjrVlsqSUgCtaamO8okhqHzRXdynctUp5Kto5KtEhLdOWS3TYjOAeMurAMeTkojQgvRkaOjcI9tUE961rRRRintIUwS41qkGfJkuo9gekuKnVq5cisKbd1mudY1WH1Pzs01IfVgsbSyuHYP3GqHIS5fkrvYMflges5fBGVaP9RXeM1CsunQ2AXIxdjueC9ma5AmHzna0ebzTyXRX8aMkjM0aGMiiRvbtYKRxVE961RxJ5bmvsmPbO4GUw8A6k1sKnRW(jxVE961RxVoKkpqwRbEo561RxNeMjtcZKto5Kto5Kto5Kto5DuoGcZsP1HM3tZKO3rfmrbR7Pzs07PzsuG7cyXOcLtVbHcPezZluUaIezWqnd1QsalgvOC6niuOiBEHsuLSzXIbHuEXg4l35K0mj6DnYMmxVt4SLqeeOmaClvFpIctoDUJr1imb4L7rsuF5odmfkhqHzpy6okhqHzVJ5bmvsmPHYSw8AWETXgVgLznS11aqteKjX8aMkjM0yXqSw8A7adRn241SyiwJYmjMhWujXKga0ebzT41qsFsWe0eYjX8aMkjM0ysefVw8AmpGPsIjnwmeRnEnMhWujXKgkZKyEatLetAakoORfVgmE96DMiaueC9scHc(iib17RVJzyIAeMGrO0qeeOma8YTy3l31qeeOm8YDuoGcZwJhWAeMC3kNGQrysf2p561RxhsLhiRxJ5bmvsmPXKikEDLTMUsTezZkSFTXRX8aMkjM0auCqRAnMhWujXKglgIQwRbEozsyMCYjN8UwhAEhLdOWS3r5akm7DRCcQgHjvy)KRxVEDivEGSwd8CYKWm5Kto5Kto5K3b40jntI6CRwJqCNsKnVq5fBGVChvWefSUZHYG18okhqHzP06qZ7akw5a3tZKO3RuIrubVdWPtAMeL(qAncXDNEdcfE9oNOHiiqz4LRxVEpYC3MnBRfXbuy2114bSgHjRfv76DG7vtRAAvtdCUBEl2bovB31Fa
    Last edited by mmoc5cadf94ec5; 2017-01-09 at 09:28 PM.

  3. #3
    Thanks, this is what I was looking for. Is it necessary to use the custom triggers though? It seems like this could be covered by the status: cooldown progress. Or would there not be a way to return your own duration info in that case?

    More general question, is there a resource somewhere for what the elements of aura_env are, and what they do? The Wiki page is pretty vague on this. Or are these variables you added, which do not normally do anything?

    Edit: I'm not actually able to log into WoW right now, but I'm still trying to figure out how the code works using wago. So sorry if these questions seem dumb.
    Last edited by Pandaburn; 2017-01-10 at 06:14 PM.

  4. #4
    Deleted
    To soothe your mind a bit: Most functions that could be used for malicious purposes are blocked by WeakAuras. So custom triggers per se are not a bad thing :-)
    Info on the aura's environment can be found on the wiki.
    The only default value that I've used was aura_env.id which is simply the name of your aura; the rest was added by me.

    I don't think that what you've described can be done with the default cooldown-status, since the only values that are maintained by the aura to advance the progress bar are the time when the cooldown will expire as well as the total duration of the cd - at least as far as i know. The current progress is then simply calculated by the formula "1 - (expiration_time - current_time) / total_cd_duration".
    This yields the percentage of how far the progress bar should be filled. As you can see, there's no place to incorporate an offset - at least without custom code.

    When it comes to efficiency, the aura that I've created isn't very demanding. Most stuff is done only once, when a cast has succeeded and a cooldown is triggered. Only the progress of the bar is updated every frame (this is always implicitly done by WA for any progress bar and progress texture) by fetching the current time and performing an addition.
    Last edited by mmoc5cadf94ec5; 2017-01-10 at 07:00 PM.

  5. #5
    Yeah, I'm not worried about malicious code, I'm just trying to learn to do these things for myself in the future. I'm a programmer, I'm just not familiar with lua or WA, and I'd like to change that.

    From your description, it seems like using the only thing I'd need to do beyond what the default cooldown progress trigger allows is change the duration of the cd, leaving the expiration time the same. But it looks like you can only provide custom duration info if you set the trigger type to "custom".

    - - - Updated - - -

    Also, this is a small nitpick, but would the bar not come up with 15sec left if something were to reduce the cooldown, like Serenity for example? Does the standard cooldown progress trigger have to poll constantly to make up for this?

  6. #6
    Deleted
    The nitpicking is absolutely justified - I completely glossed over the possibility of cooldowns being reset or reduced.
    WeakAuras fetches updated cooldown info when certain events are thrown: SPELL_UPDATE_COOLDOWN, SPELL_UPDATE_CHARGES etc.
    So there's no constant polling.

    In light of the added complexity introduced by CDs that can be reset or reduced, it probably makes most sense to let weakauras built-in trigger-system do the heavy lifting and simply siphon off the required data to update the custom duration function - which would still be required.


    Code:
    dm0JhaGivIgfuYPGs9kOkzwIiDliIDrvnmishdQ0YejnnssDnOk4BqvvJdQQmpOkQ7rk2hevCqOIfss4HquMOkHUiuvSrOQ0hHQuJeQICsiQQvQOxcvHMjjr3eIkTtvk)ueXqvjyPIu1tvAQq6QIu5RKK8wrI7kszVi)fkgm4WQAXQK8ysmzvCzInlcFMunAvQonkRgIQ8AvsnBfUnvz3O63IA4qy5u55cnDkxxW2jL(UiQXts15jPSFPjCjuA9O9q7HqPLPK50v0MiZn8D86rAts6qvjY)g(q7i)hcL2quWWfTIJUIw7hc3iuA9cdJrOKrgThwIemLWWuJqP1lmmgHsgz06YdHqP1lmmgHsgz0Iqlc7hc3iuA9cdJrOKrgTjEfJL5ekTEHHXi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Y8oluOqHcfkuq8LXJikNcAki(gZtkGKcyf9f1rWCVXYCuMNuajfI(NG7nwMJDNfkuOqHcfk4el44fe)JmSVaEvq8LXJikNcihnfqANfkuOGWpDk8tND2zND2zND2zNDsBmCLOv42gsKGPoTyqgolkMffN0JsRYDr5AAdioVj0QeIw2dJPgcH2O9wisROv4gT4j5h2DAJHReTc3UGtsWuN29c4Jkvjz0g4MJPRlocLwLq0YE0MiWvmwMJf2DwOqHcoXcoEbZfKof(PZo7SZo7KmYiJ2a3CmDDXrO0griJXT3tOB4Iu8x1PIFKrlp4H6y66Ils3sLmAJ0MQFQ(P6RAA1s3Wv1PIlzeba
    Last edited by mmoc5cadf94ec5; 2017-01-10 at 10:08 PM.

  7. #7
    I would like to expand, and possibly simplify, the meaning behind aura_env if it helps.

    Lua is basically a bunch of tables. Some are arrays, some are nested. A normal addon would have their own local tables to use throughout its code. WeakAuras don't really have that option among different functions like trigger and untrigger, unless they make a global variable, which is not only accessible and changeable by everything else but can be a performance issue depending on the usage.

    In comes aura_env. This is a special table localized specifically for each WeakAura. Anything you put in this table is usable and changeable by any function within that specific WeakAura. For example, let's say you have two WAs with a trigger and untrigger function each. WA1 states aura_env.foo="Bar" and WA2 states aura_env.foo="Rab", both in their respective trigger functions. In both untrigger functions, you call print(aura_env.foo). You will get a Bar and a Rab in your chat window.

    This is vey simplistic, ignoring what you need to even call the untrigger, but hopefully this helps.
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  8. #8
    Thanks speku,

    And thanks Kanegasi for the clarification. I realized that when I aked about aura_env, I was thinking of the sub-table aura_env.state, which the wiki describes as holding values that "depend on the type of aura being used", but doesn't go into much detail. I see now that aura_env is just being used to hold values local to the aura.

Posting Permissions

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