1. #1

    [WA2] Custom even trigger

    Disclaimer: I am very bad at custom code

    Alright guys, first off I'd like to just say that I don't need this weak aura to work, it's just that it's pissing me off that I can't make it work. I have something that does the same thing, but isn't bullet proof. It's also nice when things are automated AND bulletproof.

    What I want to accomplish: When I reset a challenge mode I want to start announcing a timer starting from 2 minutes (Not using BigWigs/DBM timer), which is the cooldown to reset it again.

    Whenever you reset a challenge mode an event happens called "CHALLENGE_MODE_RESET"

    Trigger:
    Code:
    function(event, CHALLENGE_MODE_RESET)
             local cmTimer = SendChatMessage("2:00 Until reset is ready!", PARTY)
             if event == CHALLENGE_MODE_RESET then
             return true
             end
    end
    Untrigger:
    Code:
    function()
    return true
    end
    function:
    Code:
    function()
             return cmTimer
    end
    Alright, so this is the base of it, it actually has a few more things to make a 1:30, 1:00, 0:30 and "reset ready" to happen, but it's not part of the problem.
    This aura will trigger when you enter a challenge mode(without it being started) OR if you close weak auras options while inside a challenge mode that hasn't been started. I guess the event CHALLENGE_MODE_RESET constantly triggers while at a start of a challenge mode, and not only when you reset the dungeon.

    So this makes my aura go off whenever I enter a challenge mode, so it just spams away like mad.

    Anyone have a clever solution or is the event CHALLENGE_MODE_RESET too flawed?

  2. #2
    I use one that checks on the same event and have no issues with it additionally I checked an event tracker and that is definitely only thrown on actual resets (not repeatedly as you say).

    Code:
    da0AeaGirQ6sIuyuGsDkqr3ckzxqvgMQ4yQultv6zOGPHQCnOY2qP(Mc14urNdk19av6GkqwOcYdHIMiOKlQs2OcPpcQYivaojOIvsXmHQ6MOq7uf(juyOkGwQcQNsAQk1CfPYEL(RsAWu6WiSyqv9yatgOllSzu5ZkXOrrNgYQfPOxlsPzROBJODJ0Vf1WrvTCr8CqMoX1vvBxK8DqHXRqCEuY6vGA)uDV7UkzvWQGDxn)LjIgDOQGii(tcw7yePAvGpKKj3XisvUpfqqzkSHPBCRBDRBNzaIPBfezSsZWWTW1TWlKnImGnmDRBDRBDtqbDJBCJBCJBCtvwyWXbfshL99yEN4y)(o(K35n2Slhw84vLaqqPIDcAzjsymdg94Pkum5gygrLQdHXEJbJvLe0YsK0DvHf)OkWhsYKvb(qsMCLjcmQkiYaS6NgPcQuvqKby1ivqfOQyoGbHp(xhW7ALrmG116Wx61Uk4pHqqzA173NQaFijtUkS4hvJubvQc8HKmzvUpfqqzkSJubvGPBCRBDRBrCUnsfubUWn9yoGbHp(xhW7ALrmG116Wx61o9Uvygu34w36w36w36w3MeYpH6wj5hUXTU1TUnOGU1TU1TUjOGUXnUXnUXnUXnUXnUXnUXnUXnUXnUXnUXnUP6hkw)uK0HQuLzGwyk9G9t1zMaS7QFOyLgPIKc)QcXmOs3vj)tb1DLkvbrCCiG)uy1DvieDzgvbysmNbDjQs(NcQ7QamjMZGUeDOkvQMKNr3vj)tb1DLkv5iaeuM2DvY)uqDxPs1puScI44qa)PWQWVAcbq0DvY)uqDxPsLQCzQOObh94Lxvqee)jblviaslu10GF1KybLPBw8JQiGmTkIIKvGmj)zibypURcjeaPfAGzevQI51X(A4QdoNj7XdEmunn)qcIJvv8VgDxfbwftMeZzqxcgZGHBXYTdhqHGjSQsacIeuMsmxLe0YsKa1DLQWabkm7b7NQ0p5obTSejq94U6iyWXbfspyFInEppp8opFpVFXvfebXFsWcoazAv4qLiHJaishCaYuO0raWefPcYGkRamjMZGUeKzWyL)Kqq0pzvGCEcMHbTWVQeJiyMN5KU7XBh9CmoSXM375dp23pN4WvoSWHRhm0rzFI7fhd4W(Hb2pSphFxoSWXRsLQqvFX7gVh8EhJ17ySwgFYnMbW7QP6XnV37kT
    This is the one I use if you want to save yourself the hassle.

  3. #3
    Quote Originally Posted by Zulandia View Post
    I use one that checks on the same event and have no issues with it additionally I checked an event tracker and that is definitely only thrown on actual resets (not repeatedly as you say).

    This is the one I use if you want to save yourself the hassle.
    Your aura doesnt start ticking when you enter a challenge mode? It does when I do, but I guess you are right that it isn't a constant trigger. However yours does trigger when entering a CM AND when exiting Weak auras options while inside a challenge mode for me.

  4. #4
    Okay so the code you wrote really doesn't do anything. I know you said you're bad at custom code, so let's explain what's wrong, and what's right.

    Problem 1:
    function(event, CHALLENGE_MODE_RESET)

    Your header is wrong. In WeakAuras, you give your Custom Trigger the event name. In this case, you would put in CHALLENGE_MODE_RESET for the Event(s) box.
    Now, when WeakAuras detects one of your registered events, it will call your function with the event that it saw, as well as all of the arguments that the event sent it. That said, your header should be:
    function(event, ...) but since CHALLENGE_MODE_RESET receives no arguments, you can simply have it as function(event). This is the bare minimum you should have for any custom event trigger.

    Problem 2:
    local cmTimer = SendChatMessage("2:00 Until reset is ready!", PARTY)

    SendChatMessage doesn't have a return value. It always returns nil, which is nothing. In this case, you're simply doing "local cmTimer = nil"

    Problem 3:
    if event == CHALLENGE_MODE_RESET then

    As I addressed in Problem 1, the CHALLENGE_MODE_RESET event doesn't contain any arguments, but what you're saying here is "I expect one argument to be passed from this event, and I'm calling it CHALLENGE_MODE_RESET" Keyword "I'm." What you name this parameter doesn't change anything. What you're looking for is:

    if event == "CHALLENGE_MODE_RESET" then

    but... take a step back and look at how you setup the aura. You're only giving WeakAuras a single event. It's ALWAYS going to be a CHALLENGE_MODE_RESET.


    Problem 4:
    return cmTimer

    cmTimer is undefined. You attempted to define this in your trigger as a LOCAL variable (it will only exist in its own scope), which as I explained, declared it as a nil value. This will always execute as "return nil"

  5. #5
    Quote Originally Posted by Xundir View Post
    Okay so the code you wrote really doesn't do anything. I know you said you're bad at custom code, so let's explain what's wrong, and what's right.

    Problem 1:
    function(event, CHALLENGE_MODE_RESET)

    Your header is wrong. In WeakAuras, you give your Custom Trigger the event name. In this case, you would put in CHALLENGE_MODE_RESET for the Event(s) box.
    Now, when WeakAuras detects one of your registered events, it will call your function with the event that it saw, as well as all of the arguments that the event sent it. That said, your header should be:
    function(event, ...) but since CHALLENGE_MODE_RESET receives no arguments, you can simply have it as function(event). This is the bare minimum you should have for any custom event trigger.

    Problem 2:
    local cmTimer = SendChatMessage("2:00 Until reset is ready!", PARTY)

    SendChatMessage doesn't have a return value. It always returns nil, which is nothing. In this case, you're simply doing "local cmTimer = nil"

    Problem 3:
    if event == CHALLENGE_MODE_RESET then

    As I addressed in Problem 1, the CHALLENGE_MODE_RESET event doesn't contain any arguments, but what you're saying here is "I expect one argument to be passed from this event, and I'm calling it CHALLENGE_MODE_RESET" Keyword "I'm." What you name this parameter doesn't change anything. What you're looking for is:

    if event == "CHALLENGE_MODE_RESET" then

    but... take a step back and look at how you setup the aura. You're only giving WeakAuras a single event. It's ALWAYS going to be a CHALLENGE_MODE_RESET.


    Problem 4:
    return cmTimer

    cmTimer is undefined. You attempted to define this in your trigger as a LOCAL variable (it will only exist in its own scope), which as I explained, declared it as a nil value. This will always execute as "return nil"
    Ty for taking the time and maybe I didn't give enough information. What I posted is one of the many variations I made of this weak aura, it's also the one version of it that I remembered in my head. It does check on the event CHALLENGE_MODE_RESET.

    You might see flaws in this aura however the aura I posted will trigger from reseting a challenge mode dungeon and it will post the text "2:00 Until reset is ready!" in party chat. The problem I have is that it will also trigger when entering a challenge mode dungeon aswell as when you exit weak auras options while inside an unstarted challenge mode. I do not have a problem making an aura do what I want when reseting a challenge mode dungeon. My problem is it triggering from other things, two of them that I know about so far.

    I tried to add an event called PLAYER_ENTERING_WORLD and make it not trigger when I enter the dungeon alteast, although it didn't work. Neither did ZONE_CHANGED_NEW_AREA or BAG_UPDATE

    - - - Updated - - -

    Here is another example of what I have tried

    Check on event(s): CHALLENGE_MODE_RESET, PLAYER_ENTERING_WORLD, ZONE_CHANGED_NEW_AREA

    Custom trigger:

    function(event,_,_,_)
    if event == "PLAYER_ENTERING_WORLD" or event == "ZONE_CHANGED_NEW_AREA" then
    return false;
    elseif event == "CHALLENGE_MODE_RESET" then
    return true
    end
    end

    Custom untrigger:

    function(event,_,_,_)
    if event == "PLAYER_ENTERING_WORLD" or event == "ZONE_CHANGED_NEW_AREA" then
    return true;
    else
    return true
    end
    end







    I tried different untriggers, even one based on time. I expect my attempt to not make it trigger from the new events isnt working because I did it completely wrong.
    However back to my problem, I can make it do what I want, but I cant make it to NOT trigger when I dont want it to!

  6. #6
    "Check on event(s): CHALLENGE_MODE_RESET, PLAYER_ENTERING_WORLD, ZONE_CHANGED_NEW_AREA"

    Why include those other 2 if you're just going to do this:
    if event == "PLAYER_ENTERING_WORLD" or event == "ZONE_CHANGED_NEW_AREA" then
    return false;

    Just listen to CHALLENGE_MODE_RESET. I played around with it in a CM, and no matter what I did, it never triggered when it shouldn't have when only listening to CHALLENGE_MODE_RESET

  7. #7
    Quote Originally Posted by Xundir View Post
    "Check on event(s): CHALLENGE_MODE_RESET, PLAYER_ENTERING_WORLD, ZONE_CHANGED_NEW_AREA"

    Why include those other 2 if you're just going to do this:
    if event == "PLAYER_ENTERING_WORLD" or event == "ZONE_CHANGED_NEW_AREA" then
    return false;

    Just listen to CHALLENGE_MODE_RESET. I played around with it in a CM, and no matter what I did, it never triggered when it shouldn't have when only listening to CHALLENGE_MODE_RESET
    Could you link me the aura you used?

  8. #8
    Quote Originally Posted by Henriksson View Post
    Could you link me the aura you used?
    Code:
    daK4daqicv6skqnkfkNsHQBbs2fimmf1XukltrEgiAAGQRPQABGY3euJtjoNQs3JqHdsOIfkq9qbYejuYfruBuq6JkqgjHsDsLKwjuZujv3uqStLQFcsnucvTuLepf1uf1CfqTxQ)IidwihMGflG8yatgOllzZe1NfQrRQ40qwnHIETay2Q42ez3i9BrgUcA5i8CvA6KUUQSDfY3vsz8kGZtiRxaA)sT3C2SKzqZGoBo90dIwoyZdaTS8TuVdB5leZZZWxwMw2M(ndIUdpcIY1aQzZaVRMKY1aQz5hfqrj6yJ34oQJ6Oo6KaeoDKIKks00ADKy0rdQ0msQgB8oQJ6OoQXffSXnUXnUXnUXMfau0OktGIJlIqsGL3NnFRJS4tiQAoyOZzOdXSsGIJlcNnRIgwMbExnjz(rRrfvnRiPc087wKEuK6Gnd(ieuuIAEBA2CnQO61CqIT4S(6K3hezsHaTyrM0kKzYzZaVRMKml)OakkrhRgvuD8g3rDuh1reL(iODKs8QgxuWg34g34g34g34g34g34g34g34g34g34g34g34g34g34gBg4D1Kejv0WYCnQOQzG3vtsK(GalZksQaTA(tHI)OEh2S5tsa0zZVBrIwJkchiZQWPOQZMLEhf5SvRMbrYYiG3rf5S5lIgFkZaFeoNIgxMLEhf5SzGpcNtrJlhSvRMjsNYzZsVJIC2QvZYcakkrD2S07OiNTA1mHaq5SzP3rroB1QvZYjQYOawEFcUzq0D4rqeRcab4AEWdntuXOenlAyzgbKOMbsPdyAnQdKzbqqKIsuHdjLafhxexNTAoGPKK3NHasZI57QizrMxNCOzZiqZIBqHSsDl1SiOLLVL6qHTfg(YpSPPWlWx2(cZYqbhU51qG6hVdB2m9jLjqXXfX17BMbr3HhbrRcKOMxLQfHSaqf4vbs0BGZecGfjY0yeTkcen28vfacWv8jevnhe59m5vmR1aAqPtIWzVp5qxc))9l8PLz4W2Mx()Tmu))EhshkSL)PFi))odjSzylH3Smu)WTA1818eeBqmdXuyOMcdvC4f5WqcUzEK33GpTz1g

  9. #9
    Quote Originally Posted by Xundir View Post
    Code:
    daK4daqicv6skqnkfkNsHQBbs2fimmf1XukltrEgiAAGQRPQABGY3euJtjoNQs3JqHdsOIfkq9qbYejuYfruBuq6JkqgjHsDsLKwjuZujv3uqStLQFcsnucvTuLepf1uf1CfqTxQ)IidwihMGflG8yatgOllzZe1NfQrRQ40qwnHIETay2Q42ez3i9BrgUcA5i8CvA6KUUQSDfY3vsz8kGZtiRxaA)sT3C2SKzqZGoBo90dIwoyZdaTS8TuVdB5leZZZWxwMw2M(ndIUdpcIY1aQzZaVRMKY1aQz5hfqrj6yJ34oQJ6Oo6KaeoDKIKks00ADKy0rdQ0msQgB8oQJ6OoQXffSXnUXnUXnUXMfau0OktGIJlIqsGL3NnFRJS4tiQAoyOZzOdXSsGIJlcNnRIgwMbExnjz(rRrfvnRiPc087wKEuK6Gnd(ieuuIAEBA2CnQO61CqIT4S(6K3hezsHaTyrM0kKzYzZaVRMKml)OakkrhRgvuD8g3rDuh1reL(iODKs8QgxuWg34g34g34g34g34g34g34g34g34g34g34g34g34g34gBg4D1Kejv0WYCnQOQzG3vtsK(GalZksQaTA(tHI)OEh2S5tsa0zZVBrIwJkchiZQWPOQZMLEhf5SvRMbrYYiG3rf5S5lIgFkZaFeoNIgxMLEhf5SzGpcNtrJlhSvRMjsNYzZsVJIC2QvZYcakkrD2S07OiNTA1mHaq5SzP3rroB1QvZYjQYOawEFcUzq0D4rqeRcab4AEWdntuXOenlAyzgbKOMbsPdyAnQdKzbqqKIsuHdjLafhxexNTAoGPKK3NHasZI57QizrMxNCOzZiqZIBqHSsDl1SiOLLVL6qHTfg(YpSPPWlWx2(cZYqbhU51qG6hVdB2m9jLjqXXfX17BMbr3HhbrRcKOMxLQfHSaqf4vbs0BGZecGfjY0yeTkcen28vfacWv8jevnhe59m5vmR1aAqPtIWzVp5qxc))9l8PLz4W2Mx()Tmu))EhshkSL)PFi))odjSzylH3Smu)WTA1818eeBqmdXuyOMcdvC4f5WqcUzEK33GpTz1g

    it triggers everywhere, i'd make a video, but hopefully you'll believe my word for it.

Posting Permissions

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