Quantcast
Lua code for stuf, what do i do with it? - WoWInterface
Thread Tools Display Modes
01-06-13, 06:49 PM   #1
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
Lua code for stuf, what do i do with it?

As the title says, i want my targets name to be shorten if the name is to long, like Raider's Training Dummy would become R. T. Dummy.
I found a thread on MMO about this and a guy said that this would do it ->

Originally Posted by Code
function(unit)
local name = UnitName(unit) or unit
name = name:gsub('(%S+) ',function(t) return t:sub(1,1)..'.' end)
return name
end
I do however don't have a clue what to do with this text, im quessing i should paste it in to stufs text.lua somewhere?
Could anyone give me som help with this? I really suck at this
I also wonder how it would look if i want the name to be class colored?
Thanks!
  Reply With Quote
01-07-13, 12:03 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,765
In stuf's options for the text areas on your frames, you can choose to use Lua code instead of the built-in tag system.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-07-13, 03:40 AM   #3
Rusken
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2009
Posts: 61
Ah, awesome!
So now to the second question, how do i make it class colored?
I would also want it to look like this -> Name | perchp
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Lua code for stuf, what do i do with it?

Thread Tools
Display Modes

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