Originally Posted by Shadowed
You'd have to wait until the message is actually sent. Something like the below will send the message and once it sees that you sent the message it'll drop group.
Code:
local finishedMsg = "Random Dungeon Reward Received! Thanks for Group."
local function CHAT_MSG_PARTY(msg, author)
if( msg == finishedMsg and author == UnitName("player") ) then
LeaveParty()
end
end
local function LFG_COMPLETION_REWARD)
SendChatMessage(finishedMsg, "PARTY")
print("Random Dungeon Completed.")
end
|
For that to work, you will of course have to register that event and set your local function as an OnEvent handler.