Macro help

Hey folks,

I’m hoping for some macro help here as I’m not having any luck. Currently I have a macro for Innervate and one for Rebirth that allow me to cast it on a mouseover target and announce it to party. For example, my innervate macro looks like this:

/cast [@mouseover,help] Innervate
/script if UnitIsPlayer(“mouseover”) then SendChatMessage(“Used Innervate on “…select(1,UnitName(“mouseover”))…”!”, “PARTY”) end

What I’m looking for is a macro that will announce it to party if I’m in a party OR announce it to raid if I’m in a raid but retains the mouseover target announcement. I know it’s possible because the following macro works to send the chat to Party if in a party or Raid if in a raid:

/cast Lightwell
/run SendChatMessage(“Lightwell is up, use it!”, ((UnitInRaid(“player”)and “RAID” or “PARTY”)))

I’ve not been able to incorporate the above function into my macro(s)… the only thing I’ve managed to come up with is a macro that announces to party AND raid at the same time with a simple duplication of the SendChatMessage script:

/cast [@mouseover,help] Innervate
/script if UnitIsPlayer(“mouseover”) then SendChatMessage(“Used Innervate on “…select(1,UnitName(“mouseover”))…”!”, “PARTY”) end
/script if UnitIsPlayer(“mouseover”) then SendChatMessage(“Used Innervate on “…select(1,UnitName(“mouseover”))…”!”, “RAID”) end

Any and all help is appreciated!

Before the servers went down, I was testing this:

/run local m="mouseover"; local n=UnitName(m); local function f(s) SendChatMessage("Used SPELL on " .. n .. "!", s); end if n~=nil and then if UnitInRaid(m) then f("RAID"); elseif UnitInParty(m) then f("PARTY"); end end

I was not able to test it, as it would require me to do a bunch of party stuff to test and I didn’t have time.

Instead of announcing any mouseover, it should only announces when a party or raid member has a mouseover. Party and raid members are friendly targets and you don’t need to check if they are hostile like random targets.

However, I think that you might want to consider using an addon or such for this. An addon using the combat log API can check if a cast was successful and can fit more Lua in there. This macro doesn’t pick up line of sight, range, etc.

1 Like

You should consider posting this in the UI and Macro forum as well. Just be sure to put Classic in the title.

1 Like

I haven’t been able to find an addon that handles this, at least not one that works. I would definitely agree, though, an addon would be far preferrable.

Also, that script looks pretty solid. I’ll give it a test when I get a chance. Appreciate it!

I didn’t because I figured it’d be all retail stuff but your suggestion is a sound one. I will do that, thank you. :slight_smile: