Thread Tools Display Modes
08-13-14, 02:26 PM   #1
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
checking for buff stacks in C_L_E_U

over the last couple of days me and Lyn have been trying to build a little mod that will display a set of text strings based on whether the player has particular buffs. So far we have this:

https://gist.github.com/anonymous/d23ffb8dfd3124659c46

which, despite obviously being pretty unfinished, is sort-of working. Getting how many stacks a buff has doesn't seem to be working despite best efforts though - the debug print only ever returning a maximum value of 1. Experiments with using UNIT_AURA instead provided the correct # of stacks, but we couldn't get the thing to work otherwise. Doing something wrong here?

Last edited by ObbleYeah : 08-13-14 at 02:34 PM.
  Reply With Quote
08-13-14, 03:00 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Is there some reason you're trying to use the combat log instead of UNIT_AURA to track a buff on the player?
  Reply With Quote
08-13-14, 03:06 PM   #3
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Well, tried this too and couldn't get anything at all (though it does pass stacks correctly):

https://gist.github.com/anonymous/55cbe42ae6a68b3de58b

if it's easier/better to use UNIT_AURA then great, just struggling to make it work atm

edit: actually it does seem to be working when brain freeze procs: but not for fingers of frost. hmn

Last edited by ObbleYeah : 08-13-14 at 03:16 PM.
  Reply With Quote
08-13-14, 04:00 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You're calling self:Hide() for each item in your table, so the only possible time it would be visible is if you have the last buff in the table active.
  Reply With Quote
08-13-14, 04:06 PM   #5
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
neat, that gives me something to work with. Thanks!
  Reply With Quote
08-13-14, 04:32 PM   #6
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
A couple things I would change..
Lua Code:
  1. frame:RegisterEvent("UNIT_AURA")
would be better as
Lua Code:
  1. frame:RegisterUnitEvent("UNIT_AURA", "player")
and
Lua Code:
  1. if UnitBuff("player", buff) then   
  2.     local _, _, _, stacks = UnitBuff("player", buff)
could be replaced with
Lua Code:
  1. local _, _, _, stacks = UnitBuff("player", buff)
  2. if stacks then
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » checking for buff stacks in C_L_E_U


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