Closed 2ndHouse closed 7 years ago
Stick this in somewhere and let me know if it works:
local Send = SendChatMessage
function SendChatMessage(text, chatType, ...)
chatType = strupper(chatType or "SAY")
if chatType == "INSTANCE_CHAT" and not IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and IsInGroup(LE_PARTY_CATEGORY_HOME) then
-- Convert /i to /ra or /p
chatType = IsInRaid() and "RAID" or "PARTY"
elseif (chatType == "RAID" or chatType == "RAID_WARNING") and not IsInRaid() and IsInGroup() then
-- Convert /ra and /rw to /i or /p
chatType = IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or "PARTY"
end
Send(text, chatType, ...)
end
I was trying out an addon called MacroTalk to fix this, but it was handling it wrong. A user on it's project page posted this code, and it seems to be simple and works...although need to test in premades still. It just needs assigned to a /gr or /group command.
local channel = IsInGroup(2) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup() and "PARTY"
Please try the code I posted. Rather than add a new command, it just fixes the existing channel commands to downsize in smaller groups, which seems better (doesn't require learning a new command or editing existing macros) for users.
/ra
and /rw
while not in a raid will instead send to:
/i
if you're in an instance group, or/p
if you're in a normal party./i
while not in an instance group will instead send to:
/ra
if you're in a normal raid, or/p
if you're in a normal party.No other changes occur; you'll still get "You aren't in a party" etc. if you aren't in a group at all, and no upsizing is done (eg. using /p
in a raid won't send to /ra
).
OK, inserted your code into core.lua and tested it out tonight. It seems to be working correctly using /i in my macros, even in premades. Also didn't see any errors. Working great, thanks!
Well test in a raid premade at least, have not had the opportunity to test in a party premade yet, but guessing it will work.
Hoping for a lightweight addon that creates a smart group (/gr or /group) channel. The main reason I want this is for macros to print to the correct channel. Currently the command "/i" does not work correctly for premade parties and raids.
I know both Prat and Chatter can do this but they both do way more than I want. Is it something you might implement? If not, then do you know of any addons other than Prat or Chatter that might have this functionality?