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

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's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,616
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
local _, _, _, _, _, duration, endTime = UnitBuff("player", "Inquisition")
if duration and endTime then
    return format("%d/%d", endTime - GetTime(), duration)
Censure stacks on target
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.
local name, realm = UnitName(unit)
if realm and strlen(realm) > 0 and realm ~= GetRealmName() then
     name = format("%s-%s", name, realm)
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.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote

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

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