Thread Tools Display Modes
12-20-06, 12:07 PM   #1
chgreer
A Kobold Labourer
Join Date: Aug 2006
Posts: 1
Question Re: Coloring Text Strings and Server Disconnects

Hello,

I've poked around via searches looking for an answer, but have turned up empty handed so far. I'm modifying a mod (AnnounceTarget) for my own purposes as a MA Announce mod to let everyone know what target I am currently on.

The Ultimate Goal is to output a string of text to Raid Chat along the lines of:

Code:
ATTACK NOW!
TARGET: Wild Crag Boar (Lvl 7)
MARK: yellow four-point star
I run into problems when I try to color the mark text string with the appropriate color (e.g. yellow for the star, orange for the circle, etc.).

I include the pared down code. The function GetRaidTargetIndex returns an integer which I reference to an array of strings for the right icon name. I then use SendChatMessage to broadcast the information. There is more code (checks to make sure there is, in fact, an icon, etc. that all works fine, save for the disconnection problem on the yellow star.

Code:
    -- determine raid icon
    local ANN_RAIDICONS = {
	   " |cFF00FFFFyellow four-point star|r", 
           " orange circle",    
	   " purple diamond", 
	   " green triangle", 
	   " white crescent moon", 
	   " blue square", 
	   " red cross",
	   " white skull", 
	};

    local iconNumber = GetRaidTargetIndex("target");
    RaidIconString = ANN_RAIDICONS[iconNumber];
    msgLine2 = "MARK:"..RaidIconString;
    SendChatMessage(msgLine2,ANT_CHANNEL);
Where ANT_CHANNEL is equal to the string "RAID" or "PARTY", etc.

In this example, when the target icon is the star, I will be disconnected from the server. If it is any other icon (without the color string), the mod works fine.

I recall a few patches ago where trying to spoof item links in trade channels would result in a disconnect. Is this simply a side-effect of that? Or is there, perhaps, a way around that I just haven't been able to find?

I appreciate the help in advance.
  Reply With Quote
12-20-06, 04:37 PM   #2
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
You cannot send color thru chat, and yes it's most likely to prevent link spoofing.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Question Re: Coloring Text Strings and Server Disconnects


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off