+ Reply to Thread
Results 1 to 3 of 3

Thread: Super Meter - Combat continuation based on group combat status *BUG*

  1. #1
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default Super Meter - Combat continuation based on group combat status *BUG*

    Hello guys, I am the author of Super Meter.

    Recently i added the ability to continue parsing when you die in and instance (dungeon/raid).
    I am currently looking into changing this into an automatic system based on group combat status.

    I am able to get it work for 20 people, But if there's is only 19 or less I return with a nil value.
    So I need a filter.

    Ive tried:
    > if group01 == nil then group01.combat = false (still returns 'group01' is nil)
    > if group01 then if group01.combat then inCombat = true

    to no avail.

    Here is the base code:
    Code:
    	if SuperMeter.state.all.inCombat then
    		if unitZone.type == "instance" then
    			local group01 = Inspect.Unit.Detail("group01")
    			local group02 = Inspect.Unit.Detail("group02")
    			local group03 = Inspect.Unit.Detail("group03")
    			local group04 = Inspect.Unit.Detail("group04")
    			local group05 = Inspect.Unit.Detail("group05")
    			local group06 = Inspect.Unit.Detail("group06")
    			local group07 = Inspect.Unit.Detail("group07")
    			local group08 = Inspect.Unit.Detail("group08")
    			local group09 = Inspect.Unit.Detail("group09")
    			local group10 = Inspect.Unit.Detail("group10")
    			local group11 = Inspect.Unit.Detail("group11")
    			local group12 = Inspect.Unit.Detail("group12")
    			local group13 = Inspect.Unit.Detail("group13")
    			local group14 = Inspect.Unit.Detail("group14")
    			local group15 = Inspect.Unit.Detail("group15")
    			local group16 = Inspect.Unit.Detail("group16")
    			local group17 = Inspect.Unit.Detail("group17")
    			local group18 = Inspect.Unit.Detail("group18")
    			local group19 = Inspect.Unit.Detail("group19")
    			local group20 = Inspect.Unit.Detail("group20")
    			
    			if group01.combat or group02.combat or group03.combat or group04.combat
    				or group05.combat or group06.combat or group07.combat or group08.combat
    				or group09.combat or group10.combat or group11.combat or group12.combat
    				or group13.combat or group14.combat or group15.combat or group16.combat
    				or group17.combat or group18.combat or group19.combat or group20.combat
    				then inCombat = true
    			end
    		end
    	end

  2. #2
    Rift Disciple Thorarin's Avatar
    Join Date
    Oct 2011
    Posts
    136

    Default

    The code you posted will produce an error like "attempt to index variable group01 (a nil value)". Try like this:

    Code:
    local inCombat = false
    for i = 1, 20 do
        local spec = string.format("group%02d", i)
        local unitDetails = Inspect.Unit.Detail(spec)
        if unitDetails and unitDetails.combat then
            inCombat = true
            break
        end
    end
    Even though this is slightly more optimized than your original code, I can't remember how long Inspect.Unit.Detail takes to run. In any case, I would recommend rewriting to something based on Event.Unit.Detail.Combat.
    Last edited by Thorarin; 08-27-2012 at 09:32 AM.

    KaruulAlert maintainer/co-author (Curse / Rift UI)

  3. #3
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Thorarin = Hero

+ 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