WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   LiteStats Script (https://www.wowinterface.com/forums/showthread.php?t=53051)

badness 01-13-16 10:48 AM

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

Fizzlemizz 01-13-16 10:59 AM

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.

badness 01-13-16 11:12 AM

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

Fizzlemizz 01-13-16 12:36 PM

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.

badness 01-13-16 05:11 PM

Alright thanks so much got it to work :)


All times are GMT -6. The time now is 09:48 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI