I apologize if this has been answered else where but I have been unable to find what I am looking for.
I am looking to parse the name of the player (PlayerX) in each of the following system messages.
PlayerX is already in a group.
PlayerX declines your group invitation.
PlayerX joins the party.
PlayerX has joined the raid group
Cannot find 'PlayerX'.
I have some hacked together code that will do this below that I have taken from another mod. It takes the entire string from CHAT_MSG_SYSTEM and looks for the space in the first 4 cases or the ' in the last one and sends me back just the name.
Code:
function RN_GetArgs(message, separator)
-- This procedure from DKP_System by Sammysnake
-- Declare 'args' variable.
local args = {};
-- Declare 'i' integer.
i = 0;
-- Search for seperators in the string and return
-- the separated data.
for value in string.gfind(message, "[^"..separator.."]+") do
i = i + 1;
args[i] = value;
end -- end for
-- Submit the filtered data.
return args;
end -- end RN_GetArgs()
Does Blizzard provide this information already in an arg that I am missing? Is there another/better Event that I could be looking at? Or is this the best way to obtain this information?
Any information greatly appreciated as this is my first shot at a 'real' mod.