1. #1

    Question Trouble in creation of my First addon.. UnitAura

    I have trouble in my first expirience of creating my first addon for myself.. Im new in Lua coding too.

    So here are my code:

    Code:
    EventFrame:RegisterEvent("UNIT_AURA")
    EventFrame:SetScript('OnEvent', function(self, event, unit, ...)
    if(unit == "player") then
    
    			if(UnitAura(unit, "Arcane charge", nil)) then
    			
    			local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitAura("player", "Arcane charge", nil)
    			
    			abStacks = tonumber(count)
    			
    			ChatFrame1:AddMessage("Testing AB:" .. tostring(abStacks) .. ", MS:" .. tostring(msStacks) .. ", CC:" .. tostring(ccStacks), 1.0, 0.0, 0.0, 53, 5)
    			
    			end		end		
    end)
    The problems is UnitAura("player", "Arcane charge") always returning nil.. I know what im doing it wrong but I cant understand what exactly Im doing wrong. Thx.
    Last edited by icyfresh; 2013-10-08 at 08:05 AM.

  2. #2
    Code snippet looks alright. UnitAura always returns nil when the buff is not up.

  3. #3
    A couple possibilities:

    • UnitAura is case-sensitive (I would hope it is, but don't know for sure) and the aura is actually "Arcane Charge"
    • UnitDebuff or UnitBuff will return a value for this specific aura, but UnitAura will not
    • Arcane Charge is not actually an aura

  4. #4
    Quote Originally Posted by pnutbutter View Post
    UnitDebuff or UnitBuff will return a value for this specific aura, but UnitAura will not
    How should this be possible? I thought UnitBuff/Debuff were functions which call UnitAura with a specific filter?

  5. #5
    Quote Originally Posted by Crudor View Post
    How should this be possible? I thought UnitBuff/Debuff were functions which call UnitAura with a specific filter?
    In Reference the UnitBuff/Debuff is alias of UnitAura with build in Filter Harmful/Helpful so I dont think what problem in that.

    Quote Originally Posted by pnutbutter View Post
    A couple possibilities:

    • UnitAura is case-sensitive (I would hope it is, but don't know for sure) and the aura is actually "Arcane Charge"
    • UnitDebuff or UnitBuff will return a value for this specific aura, but UnitAura will not
    • Arcane Charge is not actually an aura
    Thank you. That Help but in reference UnitAura are returning a value too...
    Last edited by icyfresh; 2013-10-08 at 01:40 PM.

  6. #6
    Just tested on my mage twink: Arcane Charge is a debuff, which is why it does not show up for UnitAura (which has the HELPFUL filter by default). Use UnitDebuff or the HARMFUL filter with UnitAura.

  7. #7
    Quote Originally Posted by Crudor View Post
    How should this be possible? I thought UnitBuff/Debuff were functions which call UnitAura with a specific filter?
    Quote Originally Posted by Crudor View Post
    Just tested on my mage twink: Arcane Charge is a debuff, which is why it does not show up for UnitAura (which has the HELPFUL filter by default). Use UnitDebuff or the HARMFUL filter with UnitAura.
    derp, I always forget this, I just assumed it was the aura itself being wacky with UnitAura, but it's just that it was a debuff and UnitAura didn't have an explicit filter...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •