Quantcast Spell ID mouseover macro ... or something like that - WoWInterface
Thread Tools Display Modes
09-10-15, 03:11 AM   #1
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Spell ID mouseover macro ... or something like that

Is there a mouseover macro that puts out spellIDs to chat when you mouseover a buff?

Or an addon that adds spellIDs to your tooltip?

Issue is, I'm using a Tag in my oUF layout to track some buff durations. Using
Code:
UnitAura(u, GetSpellInfo())
or if it is a unique name simply by something like
Code:
UnitAura(u, "Enrage")
Which is fine and all, but one spell gives me a headache, namely Sacred Shield. I want to track it's duration, but not that of it's proc. Problem is the proc buff has the exact same name as the buff and even more so, even using the wowhead spellIDs for the buff, keeps setting the duration to that of the proc buff, at times. Not all the time though. Works fine for a few refreshes and once it is messed up, it stays messed up, aka it keeps tracking the freakin proc instead.

All I care for is to keep track of the actual duration of the Sacred Shield buff so I can refresh it before it runs out.


I tried using spellIDs (from wowhead): 20925 and 148039. Same issue with both of those. I mean it's kinda shit that the proc has the same name, but can it even have the same freakin spellID? -.-

Any ideas?


Btw, this is the whole Tag, just in case...
Code:
local name, _,_,_,_,_, expirationTime, _ = UnitAura(u, GetSpellInfo(20925)) 
	if UnitAura(u, GetSpellInfo(20925)) then		
		local spellTimer = GetTime()-expirationTime
		local expire = -1*(GetTime()-expirationTime)
		local timeleft = format("%.0f", expire)
		if expire > 0.5 then
			local spellTimer = "|cfffdff52"..timeleft.."|r"
			return spellTimer
		end
	end	
end


€: I supsect the issue lies within GetSpellInfo() itself, since it also checks for the freakin name to identify a buff.

Code:
name, rank, icon, cost, isFunnel, powerType, castTime, minRange, maxRange
even if you are using a spellID instead of just the spell name. In this case the proc has the same name as the buff and thus it might get confused on timer refreshes with the proc being up. I can't think of a workaround in this case tho.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."


Last edited by Dawn : 09-10-15 at 03:22 AM.
  Reply With Quote
09-10-15, 03:38 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
You can't use a name argument with UnitAura then. You have to iterate over all buffs using index and then compare against the buff spell ID return.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
09-16-15, 04:22 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, you really don't need half those variables you're defining... if you're only going to use a value once, just use it. You don't need to assign one variable's value to another variable before you can use it. I'm also extremely confused about the logic behind doing "-1 * (x - y)" instead of just "y - x" when that's what you really want... o_O

Code:
	for i = 1, 40 do
		local _,_,_,_,_,_,expirationTime,_,_,_id = UnitBuff(u, i)
		if id == 20925 then
			local timeLeft = expirationTime - GetTime()
			if timeLeft > 0.5 then
				return format("|cfffdff52%.0f|r", timeLeft)
			end
		elseif not id then
			-- no more buffs to look at
			return
		end
	end
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
09-16-15, 11:29 PM   #4
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I just copy and pasted that, didnt give it another thought when it worked out of the box. Thanks for the heads up tho.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Spell ID mouseover macro ... or something like that

Thread Tools
Display Modes

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