Combat Chat message hook
How do you hook into the combat chat message window and parse for a string, then display that to the top of the screen?
|
It depends on what you're looking for really. There's a list of events that you can use at wowwikki Here.
You need to first register which events you want to use when the UI is loaded: Code:
function MSC_OnLoad() Code:
<OnEvent> Code:
if (event == "CHAT_MSG_SPELL_SELF_DAMAGE") then s, f, msg = string.find(arg1, "Your (.*) hits"); What that line does is check the text from the event that triggered the code and finds the first instance in the string that says "Your xxx hits" xxx being a certain skill/spell ie: Sinister Strike. The brackets around .* are what tells the script to save whatever it finds inside, after that I checked to make sure that it wasn't an empty variable and sent it on it's way. Hope that helped. If you want a good example of how to get information from the combat log, I suggest looking at the code for the Scrolling Combat Text (SCT) addon. |
All times are GMT -6. The time now is 10:01 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI