-
Posted by Lebanna on Sun, 24 Jan 2010 21:25:04
Heya,
I am very new at the lua progamming scene, so please do forgive me if this is a very simple question :)
I am trying to write a very simple addon that tells me what spellpower I have when I cast a spell (eg. when casting Earth Shield, I want to know at what level of SpellHealing i cast it at so I know whether to refresh it to higher values). I can make it show quite easily the spellpower when i cast any spell but I'm struggling to make it work for a specific spell.
Currently my code is:
function SpellCast(self, arg2)
local arg2; if(event == "UNIT_SPELLCAST_SUCCEEDED" and arg2 == "Earth Shield") then local AtCastSP,label; AtCastSP = GetSpellBonusDamage(6); label = getglobal("Spellpower".."CountLabel".."Label"); label:SetText(AtCastSP); end
end
I know that arg2 is the name of the spell but for some reason when I add in the second part of the if clause it stop registering any spell - any tips/ideas?
Thanks :)
-
Posted by Lebanna on Sun, 24 Jan 2010 21:44:00
Never mind - took a short break and figured it out :P
-
Posted by jnwhiteh on Sun, 24 Jan 2010 22:36:25
Mind sharing what you figured out? It might help other people if they have the same issue!