Hi there, I am new to addon creating, I edited remaked 1addon, which shows raid readiness by counting their flasks, scrolls, etc which shows after pressing /command and I was wondering if I can make a "history" for it.

Now, the contents of this global variable will be saved when the player reloads the user interface or disconnects. It will be reloaded at some stage when the player is logging back in.

For what you want, the best thing is probably to just add the new history entries like this:

function AddHistory(tbl)
if not CheckForConsumablesHistory then
CheckForConsumablesHistory = {}
end
table.insert(CheckForConsumables, tbl)
end

Where tbl is just the data table you show at the end of your question (or whatever). Then, you can access hese history entries usng CheckForConsumablesHistory[1], CheckForConsumablesHistory[2] or iterate over them by using ipairs(CheckForConsumablesHistory).

What do you want it to do? It'll add the entry to the table? What are you expecting to happen?

Posted by zereges on Wed, 05 Oct 2011 17:29:59

Normally it shows who has not flask/scroll/well fed and I want to add that people also to SavedVariables (like history) after I fire /command (it cyckles through raid members, and their buffs, shows who hasnot flask/scroll/well fed/.. and counts readiness of raid and I want to save history of it (like table), so I press command, it does its job and saves it to savedvariables as 1st save. Then I press it once more again, it again shows readiness, and again save itself to savedvariables as entry2 and so on.

Then the code you've written should work. Saved variables are not saved until you reload the user interface or log out. They absolutely will not be written to disk immediately. I'm not entirely sure what the problem is.