View Single Post
05-24-10, 05:44 AM   #197
zynix
A Cliff Giant
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 70
Stats display

Hello, im trying to get the stats display to work.
At the moment im trying to show money, fps, latency, SP and mp5.
the layout for the text im using, is:
Code:
{	name = "Stats",
	anchor_to = "CENTER",
	anchor_from = "CENTER",
	y_off = -450,
	x_off = -750,
	level = 10,
	text = {
	string = function()
		-- money
		local gold = format("%.1f|cffffd700g|r",GetMoney()/10000)

		-- fps
		local fps = floor(GetFramerate())

		-- latency
		local latency = select(3,GetNetStats())

		-- Healing
		BonusHeal = GetSpellBonusHealing()

		-- Mp5
		base = GetManaRegen()

		return format(":: %s :: %sFPS :: %sms :: %s sp :: %s mp5", gold, fps, latency, healing, mp5)
		end, update = 1,
		size=12, shadow=1, font = "Fonts\\HOOG0557.TTF",
	},
},

but upon login, i get this error:
Code:
Message: Interface\AddOns\LitePanels\layout.lua:209: bad argument #5 to 'format' (string expected, got nil)
Time: 05/24/10 13:37:57
Count: 1
Stack: [C]: in function `format'
Interface\AddOns\LitePanels\layout.lua:209: in function `string'
Interface\AddOns\LitePanels\core.lua:254: in function `MakePanel'
Interface\AddOns\LitePanels\core.lua:345: in function `Init'
Interface\AddOns\LitePanels\core.lua:364: in function <Interface\AddOns\LitePanels\core.lua:354>

Locals: (*temporary) = ":: %s :: %sFPS :: %sms :: %s sp :: %s mp5"
(*temporary) = "551.1g"
(*temporary) = "1000"
(*temporary) = "0"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "string expected, got nil"
Is there any chance, that you might be able to help me?
  Reply With Quote