This script works fine if you type in the pet name manually, as it appears in the Chat Frame (substituting UnitName('Pet') for the actual name):
Code:
function PetActionEXPBar_FeedPet()
local petname = UnitName("Pet");
if ( event == "CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS") then
if arg1 == ( "UnitName('Pet') gains 1 Happiness from Feed Pet Effect." ) then
PetEXPBarFeedText:Show();
PetEXPBarFeedText:SetText("1 Loyalty Gain");
end
end
end
Is there any way to insert the local 'petname' variable into the Arg 1 conditional and have it match the chat frame text?