Thread Tools Display Modes
01-24-12, 02:54 PM   #1
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
SetFormattedText

lua Code:
  1. text=""
  2. if not unit:IsIncapacitated() then
  3.     if UnitIsDead(uid) then
  4.         text = "Dead";
  5.     elseif UnitIsGhost(uid) then
  6.         text = "Ghost";
  7.     elseif not UnitIsConnected(uid) then
  8.         text = "Link Dead";
  9.     else
  10.         text = format("%0.0f | %s", unit:FracHealth()*100, VFL.Kay(unit:Health()));
  11.     end
  12. else
  13.     text ="";
  14. end

Just won't workkkk, I don't know what to do to get it to show up. c_C

text should return something like (assuming I had 100k health) 85 | 85k, but all it does is throw out errors.

Damn me. D:<
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **

Last edited by unlimit : 01-24-12 at 03:08 PM.
  Reply With Quote
01-24-12, 03:37 PM   #2
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Well, what's the error then?

Chances are you're not getting any values or invalid values (strings when you expect numbers) returned back from your functions.
__________________
Oh, the simulated horror!
  Reply With Quote
01-24-12, 03:38 PM   #3
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
c.c figured it out, format needs to be string.format.

>_<
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote
01-24-12, 03:55 PM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
format points to string.format and should have worked
  Reply With Quote
01-24-12, 08:14 PM   #5
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Originally Posted by Vladinator View Post
format points to string.format and should have worked
c.c Yeahhh, but it didn't work until I did string.format. O_o
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetFormattedText

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