Hey can someone answer a quick question for me, I am looking to filter the speaker in CHAT_MSG by unitID rather than semantic STRING match.
for example let's say my friend's name is Coolguy (he's in my party in the 2nd slot) and I'm listening for anything he said in chat
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_SAY")
f:SetScript("OnEvent", function(self, event, msg, sender, ...)
if (event == "CHAT_MSG_SAY" and sender == "Coolguy" ) then
print("Coolguy said something")
end
end)
that works.
but I'm wondering if I can use a unitID (party1 or player for example). in the API reference for CHAT_MSG, author is indicated as string but wondering if
if (event == "CHAT_MSG_SAY" and sender == party1 ) then
does not work/
also if someone can point me to a reference of how to check for words in a whole msg string... for example if I'm looking to flag any time someone says Blizzard in a sentence... I'm guessing I stick the thing in an array and search each element or something. but I'm a nob
thanks in advance