View Single Post
Old 12-22-12, 01:59 AM   #1
gmarco
Premium Member
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 97
SendChatMessage and illegal chars

Hi all,

I continue to ask questions on questions and I am sorry about it, but I googled a lot but could not find a solution to this.

I'd like to write something in a CHAT channel. And it works fine, but I was unable to write a something with the escape code to make string colored.

A sample...


Lua Code:
  1. local prgname1 = "|cffffd200addon1|r"
  2. local prgname2 =  "addon2"
  3. local msg1 = string.format("Hello %s !", prgname1)
  4. local msg2 = string.format("Hello %s !", prgname2)
  5.  
  6. print (msg1)
  7. print (msg2)
  8. SendChatMessage(msg1, "GUILD")
  9. SendChatMessage(msg2, "GUILD")

The print(msg?) works quite well but the SendChatMessage only work when the var is prgname2 because in the other case it contains illegal chars.

I check them here: http://www.wowwiki.com/ValidChatMessageCharacters

The problem is that the code doesn't complains but doesn't print either when it found such strings.

I check also:

Lua Code:
  1. SendAddonMessage( "ADDON", "Test", "GUILD" );

But it also don't print either and probably it is not I need.

So the question is ?

Have I to convert the string with some function before passing to SendChatMessage or I have to use different output type ?

Thanks very much for attention as usual.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
gmarco is offline   Reply With Quote