This is a modified version of the code i use in Prat to generate patterns for player name coloring. It handles names with foreign chars as well as not matching if your name is part of another word, and its case insensitive on the first letter, so "Name" and "name" match.
Just call it with your name to get the pattern you need.
[php] local function newPattern(name)
local u = name:match("^([\192-\255]?%a?[\128-\191]*)"):upper()
if not u or u:len() == 0 then return end
local l = u:lower()
local namepat
if u == l then
namepat = name:lower()
elseif u:len() == 1 then
namepat = "["..u..l.."]"..name:sub(2):lower()
elseif u:len() > 1 then
namepat = ""
for i=1,u:len() do
namepat = namepat .. "[" .. u:sub(i,i)..l:sub(i,i).."]"
end
namepat = namepat .. name:sub(u:len()+1)
end
return "%f[%a\192-\255]"..namepat.."%f[^%a\128-\255]"
end[/php]
I'm getting these errors in the latest beta, r220.
[2008/12/27 12:43:24-520-x53]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
---
[2008/12/27 13:08:41-520-x3]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
<in C code>: in function `CastSpellByName'
Interface\FrameXML\ChatFrame.lua:907: in function `?':
Interface\FrameXML\ChatFrame.lua:3173: in function `ChatEdit_ParseText':
Interface\FrameXML\ChatFrame.lua:2911: in function `ChatEdit_SendText':
Interface\FrameXML\ChatFrame.lua:2056: in function <Interface\FrameXML\ChatFrame.lua:2049>:
<in C code>: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:259: in function `SecureActionButton_OnClick':
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>
---
[2008/12/27 13:08:48-520-x13]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
<in C code>: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:259: in function `SecureActionButton_OnClick':
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>
/soothe. Time to go prat mate, yes I miss chatter too
Just keep using it til it doesnt work. I try to watch this thread if there is a major issue and Antiarc or someone else hasnt fixed it, im sure someone will, myself, mikk, or any number of other people.
I'm around; I just don't have a ton of mod development time these days. I try to fix issues that get mentioned on IRC, and there are a few other developers helping maintain it too.
Possibly, but unlikely. I'm not sure there's an easy way to fix it without causing taint, and I can't just enable it out of combat, because you can't unset securehooks.
If I can figure out a decent way to re-enable it, I will. It's functionality that I really do want :)
Hah, I had already gave up on chatter be updated anytime soon, so that's good news. Is the bug that when you have channel names module enabled you can't click on names on the people in your guild to whisper them?
The Highlight module highlights text in hidden channels as well as in the usual ones. I have the module highlight my name and show it in raid warning. Now when my name gets into a message in a hidden channel (e.g. addon communication channel) it still gets highlighted so sometimes I get lots of trash messages in raid warning.
Time to put on my tinfoil hat. Mods are secretly transferring information about my character. What do they plan, really?
Better watch out, they're gonna follow you into the next dark dungeon crawl, knock you out and rifle your pockets for loose grammar..... erm, I mean loose goldz roar. (fo.o)f
reading alt.-names from the guildnotes is nice, but maybe you should check if a char with this name exists ( maybe with a check for non-ascii letters. like a รข and so on)
some people write their professions in the note ;) so our maintanks "alt" is called leatherworker :)
I've just installed Chatter, and I love it. I am having one small issue and I apologize in advance if it's already been addressed. In the Edit Box Polish, I enable Free Floating and move the edit box where I want it. I then enable Free Floating (locked), to keep it there. Every time I log back in it has moved. Is there a fix for this...or is it something that I am doing wrong?
I disabled all of my addons and went in with just Chatter enabled. It worked perfectly. I then enabled nUI and it went back to doing what it was initially doing. So obviously they are not playing well together. Is there a workaround to this....or am I just going to have to make a choice between the two?
Nevermind...I just got rid of nUI and went with another.
Just call it with your name to get the pattern you need.
[php] local function newPattern(name)
local u = name:match("^([\192-\255]?%a?[\128-\191]*)"):upper()
if not u or u:len() == 0 then return end
local l = u:lower()
local namepat
if u == l then
namepat = name:lower()
elseif u:len() == 1 then
namepat = "["..u..l.."]"..name:sub(2):lower()
elseif u:len() > 1 then
namepat = ""
for i=1,u:len() do
namepat = namepat .. "[" .. u:sub(i,i)..l:sub(i,i).."]"
end
namepat = namepat .. name:sub(u:len()+1)
end
return "%f[%a\192-\255]"..namepat.."%f[^%a\128-\255]"
end[/php]
Noooooooooooooooooooooooooooooooooooooo~ *drops to knees and raises arms to sky* ~ooooooooooooo!!
[2008/12/27 12:43:24-520-x53]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
---
[2008/12/27 13:08:41-520-x3]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
<in C code>: in function `CastSpellByName'
Interface\FrameXML\ChatFrame.lua:907: in function `?':
Interface\FrameXML\ChatFrame.lua:3173: in function `ChatEdit_ParseText':
Interface\FrameXML\ChatFrame.lua:2911: in function `ChatEdit_SendText':
Interface\FrameXML\ChatFrame.lua:2056: in function <Interface\FrameXML\ChatFrame.lua:2049>:
<in C code>: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:259: in function `SecureActionButton_OnClick':
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>
---
[2008/12/27 13:08:48-520-x13]: Chatter-1.0\Modules\ChannelNames.lua:155: bad argument #1 to 'gsub' (string expected, got function)
Chatter-1.0\Modules\ChannelNames.lua:155: in function <Interface\AddOns\Chatter\Modules\ChannelNames.lua:150>
(tail call): ?:
(tail call): ?:
(tail call): ?:
CatFight\CatFight.lua:132: in function `CatFight_OnEvent'
<string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>
<in C code>: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:259: in function `SecureActionButton_OnClick':
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>
---
/soothe. Time to go prat mate, yes I miss chatter too
Just keep using it til it doesnt work. I try to watch this thread if there is a major issue and Antiarc or someone else hasnt fixed it, im sure someone will, myself, mikk, or any number of other people.
Possibly, but unlikely. I'm not sure there's an easy way to fix it without causing taint, and I can't just enable it out of combat, because you can't unset securehooks.
If I can figure out a decent way to re-enable it, I will. It's functionality that I really do want :)
Date: 2009-01-21 15:53:55
ID: 54
Error occured in: Global
Count: 1
Message: ..\AddOns\Chatter\Modules\AltNames.lua line 134:
attempt to index field '?' (a nil value)
Debug:
[C]: ?
Chatter\Modules\AltNames.lua:134: func()
..\FrameXML\UIDropDownMenu.lua:561: UIDropDownMenuButton_OnClick()
[string "*:OnClick"]:1:
[string "*:OnClick"]:1
AddOns:
Swatter, v5.1.3715 (SnaggleTooth)
AHsearch, v3
Ampere, v3.0.3.14
ArcHUD2, v2.2
AtlasLoot, vv5.03.02
AucAdvanced, v5.1.3715 (SnaggleTooth)
AucFilterBasic, v5.1.3715 (SnaggleTooth)
AucFilterOutlier, v5.1.3715.2531
AucMatchUndercut, v5.1.3715.2531
AucScanData, v5.1.3715 (SnaggleTooth)
AucStatClassic, v5.1.3715 (SnaggleTooth)
AucStatHistogram, v5.1.3715 (SnaggleTooth)
AucStatiLevel, v5.1.3715 (SnaggleTooth)
AucStatPurchased, v5.1.3715 (SnaggleTooth)
AucStatSales, v5.1.3715.2842
AucStatSimple, v5.1.3715 (SnaggleTooth)
AucStatStdDev, v5.1.3715 (SnaggleTooth)
AucStatWOWEcon, v5.1.3715.2530
AucUtilAHWindowControl, v5.1.3715.3311
AucUtilAppraiser, v5.1.3715.2530
AucUtilAskPrice, v5.1.3715.3175
AucUtilAutoMagic, v5.1.3715.3142
AucUtilCompactUI, v5.1.3715.2530
AucUtilEasyBuyout, v5.1.3715.3583
AucUtilItemSuggest, v5.1.3715.3108
AucUtilPriceLevel, v5.1.3715.2545
AucUtilScanButton, v5.1.3715.2530
AucUtilScanFinish, v5.1.3715.2530
AucUtilScanProgress, v5.1.3715.2530
AucUtilSearchUI, v5.1.3715.3483
AucUtilSimpleAuction, v5.1.3715.3708
AucUtilVendMarkup, v5.1.3715.2530
Babylonian, v5.1.DEV.130
BadBoy, v2.2.0.4
BagnonForever, v1.1.1
BagnonTooltips, v
BankStack, v1
BeanCounter, v5.1.3715 (SnaggleTooth)
BrokerProfessions, v1.0
BrokerRecount, v1.0
Buffet, v3.0.3.26
ButtonFacade, v0.1Alpha
ButtonFacadeSerenity, v3.0.36
Chatter, v1.0
Combuctor, v2.0.7
CombuctorSets, v
Configator, v5.1.DEV.130
CreatureComforts, v3.0.3.67
DBMCore, v
DebugLib, v5.1.DEV.130
dHunterTool, v3.11
DockingStation, v0.2.1 (Beta)
Dominos, v1.8.3
DominosBuff, v
EggTimer, vv0.2.2-beta2 (r3)
EnhTooltip, v5.1.3715 (SnaggleTooth)
ErrorMonster, v3
FacadeBuffs, v1
FireExit, vr3
FishermansFriend, v
GFWLinkerator, v3.0.1
GFWReagentCost, v2.4
Grid2, v$Rev: 39 $
Grid2Alert, v
Grid2StatusRaidDebuffs, v
HatTrick, v
Informant, v5.1.3715 (SnaggleTooth)
Junkie, v2.4.3-1.5
Kennel, v3.0.3.7
KeyBoundExtra10, v
LibKeyBound10, v
LightHeaded, v274
MainAssist, v2.3
Mapster, v1.1.2
MiniTrinketMenu, v
MobNotes, v1.1
Nudge, v
Nudist, v3.0.1.2
Omen, v3.0.6
OmniCC, v2.2.5
Opticon, v2.4.3-0.7
Pawn, v1.1.7
picoFPS, vAlpha
picoFriends, v3.0.3.4
picoGuild, v3.0.3.5
Postal, v3.0.1
RBM2, v
RBM2CooldownWatch, v1
RBM2DeBuffWatch, v1
Recount, v
RecountDeathTrack, v
Select, v
Squeenix, v3.0.2.9
Squire, vr54
StatBlockAmmo, v2.2.1
Stubby, v5.1.3715 (SnaggleTooth)
tekability, v3.0.3.4
tekJunkSeller, v2.3.2.1
teksLoot, v3.0.2.5
Tipsy, v1.0
TomTom, v193
VendorBait, v3.0.3.2
(ck=a46)
Better watch out, they're gonna follow you into the next dark dungeon crawl, knock you out and rifle your pockets for loose grammar..... erm, I mean loose goldz roar. (fo.o)f
quote from a 10 month old post in this thread, but still seems to apply (as i havent seen a reply to it)
is this intended or a bug ?
some people write their professions in the note ;) so our maintanks "alt" is called leatherworker :)
I disabled all of my addons and went in with just Chatter enabled. It worked perfectly. I then enabled nUI and it went back to doing what it was initially doing. So obviously they are not playing well together. Is there a workaround to this....or am I just going to have to make a choice between the two?
Nevermind...I just got rid of nUI and went with another.