View Single Post
02-20-23, 01:55 AM   #2
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi all,

I'd like to refresh this topic because it drives me crazy

Is possible that in DragonFlight (latest patch) the
Lua Code:
  1. SendChatMessage()
has known limitations that unfortunately I am unable to find ?

I explain better.

Lua Code:
  1. [... parse COMBAT_LOG_EVENT_UNFILTERED ... ]
  2. if clevent=="SPELL_DISPEL" then
  3.     p_autopsy_msg = string.format(L["%s: %s dispelled %s %s %s"],prgname,classcolor(sourceName), destName, GetSpellLink(suffixParam1) or suffixParam2, usedSpell)
  4.     autopsy_msg = string.format(L["%s: %s dispelled %s %s %s"],prgname,sourceName, destName, suffixParam2, usedSpell)
  5. end
  6.  
  7. -- I want to send in chat the dispel announce for example.
  8. -- I made 2 message because I remembered that there was problem with color code in sendchat.
  9.  
  10. -- if , for example, I am in a dungeon5 finder I am inside here:
  11. if IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then
  12.     print(p_autopsy_msg)
  13.     SendChatMessage(autopsy_msg, "INSTANCE_CHAT")
  14. end

to test I have used also a print() and it works while the second SendChatMessage() no.
And I dont understand why :/

Same story for:

Lua Code:
  1. if IsInGroup(LE_PARTY_CATEGORY_HOME) then
  2.     if IsInRaid() then SendChatMessage(autopsy_msg, "RAID") end
  3.     if IsInGroup() then SendChatMessage(autopsy_msg, "PARTY") end
  4. end
  5.  
  6. if not inGroup then
  7.     print(p_autopsy_msg)
  8. end

I have tried also to use in this way:
Lua Code:
  1. SendChatMessage(autopsy_msg, IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and 'INSTANCE_CHAT' or IsInRaid() and 'RAID' or IsInGroup() and 'PARTY' or 'SAY')

But it doesnt want to work.

Any idea will be, as always, really appreciated.

Thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote