Stuf Custom String - Lua
I'm trying to create a text pattern for my stuf frames that would show a percentage of mana with the added exact amounts depending on whether the amount of mana is at max or not.
For example: 100% - 20000 or 80% - 16000 / 20000 Originally I simply had this as the input: Code:
[percmp]%[solid_if_mp99: - ][solid_if_mp99:curmp][solid_if_mp99: / ][solid_if_mp99:maxmp] So I started working on an Lua version here: Code:
function(unit, cache, textframe) Code:
1x Stuf-3.3.006\text.lua:102: invalid option in `format' Code:
local function AddAdvanceText(fs, a1, ...) "text" does return the proper string, am I missing something? |
You can use [color_ifnot_mp99] to reverse the mp99 tag.
|
Quote:
Any idea why my Lua setup was creating a format issue? |
From what you posted, it looks like you used single-quotes (') where it expected double-quotes (").
The format string is supposed to be in double-quotation marks, from my understanding of Lua. Code:
local function truncate(value) |
In lua, single or double quotes are one in the same; You can use either.
|
Quote:
|
Good information to know. :-)
|
This allows you to display quotes in a string. :)
print("This is 'quoted text.'") >>This is 'quoted text.' print('This is "quoted text."') >>This is "quoted text." |
Regardless of which sets of " " ' ' I use, I still get the format error.
It's come down to using the ".." operator or expression extension (doesn't know the proper term) that will return a format issue. Any single termed string or variable that is a single termed string will not give a format issue. |
All times are GMT -6. The time now is 02:15 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI