Thread Tools Display Modes
01-13-16, 10:48 AM   #1
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
LiteStats Script

Hey I'm in need of some help understanding this script from the litestats addon. It is to clear all money data but I have no idea how to get it work. Ive tried copy and pasting the whole thing but it didnt work.

/script for _,t in pairs(LPSTAT) do if type(t)=='table' then t.Gold = nil end end
  Reply With Quote
01-13-16, 10:59 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Code:
for _,t in pairs(LPSTAT) do 
	if type(t)=='table' then 
		t.Gold = nil 
	end 
end
Essentially looping through a table (LPSTAT) and testing to see if an entry is another table. If it is then setting that tables ["gold"] entry to nil.
Code:
LPSTAT = {
	TableEntry1 = {
		gold=100,
		silver=50,
		copper=10,
	},
	NonTableEntry1 = "Something",
}
If LPSTAT looked something like that then TableEntry1 would have its gold set to nill but NonTableEntry1 would be ignored because it is a string.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-13-16 at 11:11 AM.
  Reply With Quote
01-13-16, 11:12 AM   #3
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
Ok soo if i run this ingame how would I go about clearing a specific character's gold data or even the entire table? Because i renamed one of my characters the other day and its gold data is still showing up in the tooltip
  Reply With Quote
01-13-16, 12:36 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
It would be easiest (before logging on and after making a copy) to find the character entry in the LiteStats.lua in the WTF\Account\[Your Account]\SavedVariables folder and delete it.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-13-16, 05:11 PM   #5
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
Alright thanks so much got it to work
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » LiteStats Script

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