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 if bu("Pet","Lesser Invisibility") then UseContainerItem(0, 1) else CastPetAction(7) UseContainerItem(0, 1) end