Bugreporter 93 Posted October 6, 2016 Share Posted October 6, 2016 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); Link to comment https://wrobot.eu/forums/topic/4033-event-handling-possible/ Share on other sites More sharing options...
Droidz 2738 Posted October 7, 2016 Share Posted October 7, 2016 Hello, test.xml (not tested) Link to comment https://wrobot.eu/forums/topic/4033-event-handling-possible/#findComment-18766 Share on other sites More sharing options...
Bugreporter 93 Posted October 7, 2016 Author Share Posted October 7, 2016 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) . Link to comment https://wrobot.eu/forums/topic/4033-event-handling-possible/#findComment-18768 Share on other sites More sharing options...
Droidz 2738 Posted October 7, 2016 Share Posted October 7, 2016 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). Link to comment https://wrobot.eu/forums/topic/4033-event-handling-possible/#findComment-18771 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now