WeakAuras

Ability usable trigger question

  • 10 posts
    #1 Nov 30, 2010 at 10:25 UTC - 0 likes

    I'm using it for an aura to indicate OB/FS availability on my DK, and it works, except it doesn't check for melee range, thus displaying when OB/FS is ready to use, but the target is OOR. Any way I could check for melee range, or range in general in WA?

    Last edited Nov 30, 2010 by Urfin13
    #2 Nov 30, 2010 at 14:16 UTC - 0 likes

    No. I might consider implementing range checking, but it's a low priority.

    #3 Nov 30, 2010 at 15:27 UTC - 0 likes

    Too bad. Range checking that you can use as a trigger would make some really nice automagic possible.

    What if I could make another addon (IceHUD is the only one I know that has a configurable range checker) talk range numbers to chat, and check them with WA? Would that be possible?

    #4 Dec 01, 2010 at 00:45 UTC - 0 likes

    @Urfin13: Go

    Well, if you're willing to do that much work, you can do range checking using a Custom Trigger in WeakAuras. As far as I know, there are no events that fire when ranges change, so you'd have to have your trigger update every frame, which would be CPU inefficient (which is why I don't want to implement range checking in the first place).

    Anyway:

    • Trigger Type: Custom
    • Event Type: Status
    • Check On: Every Frame
    • Custom Trigger:
    function()
      if(IsSpellInRange("Frost Strike", "target") == 1) then
        return true
      else
        return false
      end
    end
    
    • Custom Untrigger:
    function()
      if(IsSpellInRange("Frost Strike", "target") == 1) then
        return false
      else
        return true
      end
    end
    

    Would check range.

    Last edited Dec 01, 2010 by Mirrormn
    #5 Dec 03, 2010 at 16:45 UTC - 0 likes

    Thanks, that is just perfect! BTW, I'm not seeing any noticeable performance hit with 3 auras using this trigger.

    #6 Mar 28, 2012 at 23:44 UTC - 0 likes

    Hi!

    I was quite happy when I just now found this post but I found out that it did not work for my. Might that have to with changes between this post and now?

    If I use the above provided code the aura is displayed all the time, regardless of range. This might have to do with the check on situation, there is only OnUpdate which set to use. I would like to use this range check to build some auras to give me options based on when they become available when I close in on my selected target. Right now I look when the assigned keys in the button bars turn from red to white and that is a not so good idea.

    Any help is appreciated, if need be I can export the aura in it's present state.

    #7 Jan 14, 2013 at 11:13 UTC - 0 likes

    Hi!

    here the updated code in example for Clash:

        Trigger Type: Custom
        Event Type: Status
        Check On: Every Frame
        Custom Trigger:

    function()
      if(IsSpellInRange("Clash", "playertarget") == 1) then
        return true
      else
        return false
      end
    end

    Custom Untrigger:

    function()
      if(IsSpellInRange("Clash", "playertarget") == 1) then
        return false
      else
        return true
      end
    end

    Last edited Jan 14, 2013 by mickzit
    #8 Jan 19, 2013 at 07:00 UTC - 0 likes

    Loving WeakAuras, but I too really wish it had a range check, both for player to target, as well as pet to target.

    In the meantime, thank you for the code above. I was hoping you might help me out in modifying it a bit for my custom purpose. I want to range check my pet to target for Kill Command.

    Any chance you might be able to modify the above code to fit that (right now it only checks range for me (player) to target). Thanks!

    #9 Jan 19, 2013 at 12:51 UTC - 0 likes

    I don't think range checking for pet abilities can be done. The only range checks available in the API that I could find are for the player. However, there is a function that checks if a pet ability is usable. I don't play a hunter but I'm under the impression that kill command isn't even clickable unless the pet is in range, so you might be able to get the result you want that way. Of course if someone else can find a better one, I'd love to see it.

    For range checking to be effective it has to be checked on a very short interval. When you combine this with the fact that you typically have well over a dozen abilities that have to be tested every fraction of a second, it places a heavy burden on the CPU for an already CPU intensive game. I can see why the author wouldn't want to implement this because some idiot would range check every ability in their spellbook and complain that weakauras is killing their frame rates. You can work around this by only checking ranges for a few key things, such as "my melee range strikes" and "my 40yd spells" and call it good without too much of a strain.

    #10 Aug 12, 2013 at 20:02 UTC - 0 likes

    Sort of a necro here, and I dont know of this helps the question but you can range check your pet's distance from you using RangeDisplay addon.

    http://www.curse.com/addons/wow/range-display

  • 10 posts

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