Thread Tools Display Modes
01-03-13, 12:07 AM   #1
Kuthumii
A Murloc Raider
AddOn Compiler - Click to view compilations
Join Date: Jun 2008
Posts: 6
LuaTexts

I just got started playing MoP after a year or so break from WoW. I'm not familiar with Lua at all so if anyone is willing to help great!

-I need some texts that will allow me to monitor if I have Inquisition up (player unit).
-I need some texts that will allow me to monitor if my target has Censure and the number of stacks.
-I need a way to truncate the already included Name text as sometimes it is to big.

Thanks for the help!
  Reply With Quote
01-03-13, 01:53 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I'm not familiar with how you actually enter things for LuaTexts tags, but these Lua snippets should get you started, and maybe someone else can explain how to get them into LuaTexts:

Inquisition seconds remaining on player
Code:
local _, _, _, _, _, duration, endTime = UnitBuff("player", "Inquisition")
if duration and endTime then
    return format("%d/%d", endTime - GetTime(), duration)
end
Censure stacks on target
Code:
local _, _, _, count = UnitDebuff("target", "Censure")
return count or 0
Remove the "or 0" part if you don't want to see a 0 when the target doesn't have Censure.

Shorter name text
I'm not sure what the included name tag is showing that's too long, or what length you consider "too long", but this will return "Name" for same-realm players, or "Name-Server" for cross-realm players, and cap the whole thing at 20 characters.
Code:
local name, realm = UnitName(unit)
if realm and strlen(realm) > 0 and realm ~= GetRealmName() then
     name = format("%s-%s", name, realm)
end
return strlen(name) > 20 and strsub(name, 1, 20) or name
This snippet will not do anything by itself, as the pink part ("unit") is a variable that needs to be set/renamed to work with LuaTexts.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » LuaTexts


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