/cast Life Tap
/stopmacro [nogroup]
/p Tap! Tap! Tap!
/stopmacro [nogroup:raid]
/raid Tap! Tap! Tap!
To avoid spamming /p in raids, you will need to do macro branching with /click. This example uses ActionButton 11 and 12:
/cast Life Tap
/click [group:raid] ActionButton11
/stopmacro [group:raid]
/click [group:party] ActionButton12
On ActionButton11 you place the following command: /raid Tap! Tap! Tap!
On ActionButton12 you place the following command: /p Tap! Tap! Tap!
To get the name of a button, you mouse over it and use the command:
/run local f = GetMouseFocus() if f and f:GetName() then ChatFrame1:AddMessage(f:GetName()) end
It's a bit complex, and can actually be solved using script commands instead:
/cast Life Tap
/run local c if GetNumRaidMembers() > 0 then c="RAID" elseif GetNumPartyMembers() > 0 then c="PARTY" end if c then SendChatMessage("Tap! Tap! Tap!", c) end