+ Reply to Thread
Results 1 to 6 of 6

Thread: How do I find out if anyone is in combat?

  1. #1
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default How do I find out if anyone is in combat?

    I don't need the full power of Safe's Raid Manager, and I need to know if anyone in my group is in combat, regardless of whether the player or anyone else is dead. AFAIK, the secure console is for the player, not the rest of the group.

  2. #2
    Rift Chaser NerfedWar's Avatar
    Join Date
    Dec 2010
    Posts
    377

    Default

    The most 'lightweight' method is to track Event.Unit.Detail.Combat.

    If you don't need to make the call very frequently then the API call Inspect.Unit.Detail(unitId) for the 'combat' variable should do the trick.

    unitIds will be group01 -> group 20
    ...the internet treats censorship as damage, and routes around it...
    NerfedWar Addons and Tutorials
    * Note: tutorials are currently being ported to the new site.

  3. #3
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default

    I totally missed that event, thanks!

    **Edit: the combat variable is boolean, I take?
    Last edited by Lorandii; 06-25-2012 at 07:31 AM.

  4. #4
    Rift Chaser NerfedWar's Avatar
    Join Date
    Dec 2010
    Posts
    377

    Default

    Quote Originally Posted by Lorandii View Post
    I totally missed that event, thanks!

    **Edit: the combat variable is boolean, I take?
    hehe, I too get a surprise when I look at the Event list, seems to grow significantly each patch thanks to the hard work of Zorba and co.

    With regards the variable, I assume so but can't remember, let me just do a quick in game test...
    ...the internet treats censorship as damage, and routes around it...
    NerfedWar Addons and Tutorials
    * Note: tutorials are currently being ported to the new site.

  5. #5
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    Quote Originally Posted by Lorandii View Post
    I totally missed that event, thanks!

    **Edit: the combat variable is boolean, I take?
    Yes

    Fairly sure all .Detail. events just fire the new value (as outlined in the Inspect.Unit.Detail docs)
    Rank 76 Guardian Mage

  6. #6
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default

    While you do your test, I wondered if the same event can be used to verify that the entire group is NOT in combat? This seems overly long to me, but probably works. Essentially, what I am trying to determine is whether or not the group has wiped on a boss.
    Code:
    for id, status in pairs(units) do
        -- get num of units first!
        local nonCombatCount = 0
        if inspect.unit.detail(id).combat then
            Print("The unitID $d is in combat!", id)
         else
            Print("The unitID #d is NOT in combat", id)
            nonCombatCount = nonCombatCount + 1
        end
    
        if nonCombatCount == numGroupMembers then
            Print("Nobody is in combat!")
        end
    end

+ 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