I last created Mods back before Cataclysm. It's been a long time. Just now getting back into it. I'm just trying to write a very basic mod that cancels attacking with the right mouse button.
WorldFrame:HookScript("OnMouseUp", function(self, button)
if button == "RightButton" then
local mouseoverName = UnitName("mouseover") or "Unknown";
local reaction = UnitReaction("mouseover", "player") or 10;
if reaction < 5 then
DEFAULT_CHAT_FRAME:AddMessage("Stopped Attack on: "..mouseoverName);
DEFAULT_CHAT_FRAME:AddMessage(mouseoverName.." is friendly! "..reaction);
The code I have should be working (from what I can tell) - but it's not. I'm guessing that the unitId "mouseover" is no longer valid because if I swap it out for "player" it works fine. Any insight on why it's not working or how to fix it would be appreciated... Also if there is just a better way to do things I'm all ears.