Thread Tools Display Modes
03-17-12, 04:08 AM   #1
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
CombustionHelper-like oUF tag?

Hey guys,

I recently started a firemage twink and I need to integrate something like CombustionHelper into my UI. Unfortunately this addon has a terrible clumsy look and I dont need all the features, the most relevant one for me is the line showing the tick height of the ignite dot. So I want to make a oUF tag for it, if thats possible.

Has anyone done this before? I need to access the target's debuffs by name and then somehow extract the dot length / tick height. Maybe this can be done by accessing the tooltip text and extract the relevant numbers from there (are there regular expressions in LUA)?

Regards
Iron

PS:

If you think this any further, the same mechanism could be useful to track:
- DK necrotic strike absorption amount
- Feral tank mastery absorption amount
- Priest shield absorption
- ...

Last edited by Irongunner : 03-17-12 at 09:18 AM.
  Reply With Quote
03-17-12, 08:08 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I need some eye bleach after looking at that addon's code.

Anyway, Lua does have regular expressions, but it calls them "patterns". If the tooltip for the Combustion debuff shows the correct damage amount, then you could use tooltip scanning to extract that amount. This involves creating a custom hidden tooltip, though, so it may be more appropriate for a full plugin than for a simple tag, especially if you need to keep track of other details like talents or glyphs. The addon you linked looks at both of those things, and more, but as I haven't played a mage since 2005 or so, I don't really know how much of that is relevant for just Combustion.
  Reply With Quote
03-18-12, 05:47 AM   #3
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
I tried tooltip scanning but unfortunately the ignite tooltip does not show the dmg amount / tick height. I guess the only way to get the numbers is to wait for dot ticks in the combat log :/
  Reply With Quote
03-18-12, 06:21 AM   #4
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
I did something slightly similar to this for monitoring the Vengeance value when I play my feral tank: https://github.com/Evilpaul/oUF_VengeanceBar

For what your after then to do the same mechanism it would rely upon scanning your target's debuffs instead of your own, and also relies upon the value you are after being part of the aura tooltip.

While an oUF tag may be the obvious choice due to only wanting to display a text value, the complexity of what you want to achieve would be better if implemented in a new element.



If you do have to read the information from the combat log then it will mean that it makes tracking information across multiple targets simpler. You just need to ensure you can handle displaying multiple target information, handle target deaths and clear targets when out of combat.
  Reply With Quote
03-18-12, 11:14 AM   #5
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
Here it is, my ultra-hacky solution ^^

- Have CombustionHelper addon activated
- Hide clumsy window:
Code:
CombustionFrame:SetScript("OnShow", function(f) f:Hide() end)
CombustionFrame:Hide()
- Use this tag, which only shows the ignite dot tick height (extracted from CombustionHelper frame):
Code:
oUF.TagEvents["ignite"] = "UNIT_AURA"
oUF.Tags["ignite"] = function(unit)
	if IgniteLabel then
		local dmg = tonumber(string.match(IgniteLabel:GetText(), "(%d+) .*"))
		if dmg then return dmg end
	end
	return ""
end
- Place it where you want it to be

And for my tank druid I created the following one, using tooltip scanning:

Code:
local parseNumber = function(text)
	return string.match(text, ".* (%d+) .*")
end

local dummyTooltip
oUF.TagEvents["absorb"] = "UNIT_AURA"
oUF.Tags["absorb"] = function(unit)
	local i = 1
	while true do
		local name, _, _, _, _, _, expirationTime, unitCaster, _, _, spellId = UnitBuff(unit, i)
 		if name then
			if (spellId == 62606) and (unitCaster == "player") then
				if not dummyTooltip then
					dummyTooltip = CreateFrame("GameTooltip", "DummyTooltip", nil, "GameTooltipTemplate")
					dummyTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
				end
				dummyTooltip:SetUnitBuff(unit, i)
				return parseNumber(_G[dummyTooltip:GetName() .. "TextLeft2"]:GetText())
			end
		else
			return ""
		end
		i = i + 1
	end
end
Should work for Priest Shields and DK Necrotic Strike absorption too (with different spellId).
Maybe change UnitBuff(..) and SetUnitBuff(..) to UnitDebuff(..) and SetUnitDebuff(..).

Last edited by Irongunner : 03-18-12 at 11:23 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » CombustionHelper-like oUF tag?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off