Posted by diphal on Wed, 31 Oct 2012 16:39:34
Hi guys, I need some help with custom function for one addon (Weak Auras). Im trying to get name of Stormlash Totem caster and announce it to say channel. But Im not that good in lua so Im just trying to combine pieces of code together with no avail ofc :) my best shot was this:
function announce (event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...) if message == "SPELL_SUMMON" and spellName == "Stormlash Totem" then SendChatMessage(sourceName .. " applied Stormlash Totem!", "SAY"); return true end end
I guess its all wrong but at least Im trying. Can you help me with this? Thx.
Posted by jnwhiteh on Wed, 31 Oct 2012 19:38:09
That's a start, but you'd need to create a frame and register for the appropriate events in order for it to work.
Posted by diphal on Wed, 31 Oct 2012 23:34:03
I guess that frame and other things are handled through Weak Auras addon. This is just one custom function amongst many.
Posted by efindel on Thu, 01 Nov 2012 18:27:03
Is there an existing "announce" function that you're adding this code to, or are you creating the function? If it's the latter, it's not going to do anything unless you modify other code in the addon to call it when needed.