October 6, 20169 yr Hi, is it possible to add event handling in a fight class ? In this sample someone shout "Hero" and the mage/shaman/whatever cast Bloodlust/Timewarp/whatever. local frame=CreateFrame("Frame"); --[[Need a frame to capture events]] frame:RegisterEvent("CHAT_MSG_SAY"); --[[Register our event]] frame:SetScript("OnEvent",function(self,event,msg) --[[ OnEvent handler receives event triggers ]] if event=="CHAT_MSG_SAY" and msg=="HERO" then --[[ Someone sends "HERO" in /say ]] hero=SpellInfo(2825) CastSpellByName(Hero) end end);
October 7, 20169 yr Author Okay, I see, you use a global variable to check a registred frame, hmmm, thats what i try to prevent. (PQR was detected by this) .
October 7, 20169 yr There is little chance that Bliz target your figth class. You can use a global variable name used in legal Wow addons to avoid this problem (or C# code to read chat).
Create an account or sign in to comment