--In the Function window (right) function bu(u, b) local i = 1 while (UnitBuff(u, i)) do if (string.find(UnitBuff(u, i), b)) then return true end i = i + 1 end return false end --In the Macro window (left) /script if bu("Pet","Prowl") then UseContainerItem(0, 1) else TogglePetAutocast(7) CastPetAction(7) UseContainerItem(0, 1) end