+ Reply to Thread
Results 1 to 3 of 3

Thread: Nearby Units

  1. #1
    Rift Disciple Adansonia's Avatar
    Join Date
    Jan 2011
    Posts
    153

    Default Nearby Units

    One more question: I am trying to make an addon that will alert when there are rare mobs nearby (like WoW rare radar addons). I tried using Event.Unit.Add but it seems to only trigger whe I /tar the mob.
    Is there a way to list all units around without targeting them?
    Last edited by Adansonia; 06-08-2016 at 07:34 AM.
    Dimensions on NA: Shoreward spa @ Faeblight

    Dimensions on EU: ENIGMA - the Spa @ Zaviel
    Marcienn's Magic Mansion @ Zaviel

  2. #2
    Prophet of Telara
    Join Date
    Sep 2010
    Posts
    1,008

    Default

    Quote Originally Posted by onyxshia View Post
    One more question: I am trying to make an addon that will alert when there are rare mobs nearby (like WoW rare radar addons). I tried using Event.Unit.Add but it seems to only trigger whe I /tar the mob.
    Is there a way to list all units around without targeting them?

    Try Inspect.Unit.List

    and possibly

    Code:
    local function UnitList()
        local inspect = Inspect.Unit.Detail
        local list = Inspect.Unit.List()
        local format = tostring
        for k,v in pairs(list) do
            local detail = inspect(format(k))
            if detail and detail.name == "YourRareNPCName"
                print("NPC = ".. detail.name)
            end
        end
    end
    or look in the code of the RareTracker or RareDar addon

  3. #3
    General of Telara
    Join Date
    Mar 2014
    Posts
    967

    Default

    To my knowledge, Event.Unit.Add/Remove only get triggered when a unit specifier changes (i.e. the unit changes focus/group/mousover status or its target, pet or owner changes).

    You probably want to track Event.Unit.Availability.* events.
    Dimension Addon 'Tinker Tools' is now available on Curse!
    Or grab the latest development code on GitHub.

+ Reply to Thread

Bookmarks

Posting Permissions

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