Thread Tools Display Modes
07/06/23, 10:47 AM   #1
Ganza-ESO
Join Date: Sep 2015
Posts: 2
LUA script to Extrtact Flat Data from Saved Variables

I have been looking for some code to extract the saved variables from Lua files that works with a Lua interpreter. Specifically trying to work with MasterMerchant.lua to pull the EXPORT data out, but searches on the internet have not provided much useful information.

I was hoping that someone here might have something already worked up or something that I can modify to achieve my objective.

I am considering writing a program that manages LibHistoire data offline as well.

Last edited by Ganza-ESO : 07/06/23 at 04:55 PM.
  Reply With Quote
07/06/23, 03:34 PM   #2
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Well whatever you do develop most likely I have more or less no say in it to some point.

There is already an export feature if you read the docs and it does work easily with a spreadsheet. I have even seen someone recently specify to use the custom delimiter of the & on google sheets. I don't know how things have been done in the past with that delimiter but you are limited because of how the Lua saved variables work. It has been done the same way since the beginning and I'm not willing to change that.

If you just want this for personal use I understand. It serves no useful purpose to know when something sold for x amount in Sept of 2022.

If for a mod then use LibHistorie directly that's what it's for. MM is not a library data receptacle for other mods to access.

If not for personal use then:
Warning: Spoiler

Last edited by Sharlikran : 07/06/23 at 06:16 PM.
  Reply With Quote
07/06/23, 06:19 PM   #3
Ganza-ESO
Join Date: Sep 2015
Posts: 2
Originally Posted by Sharlikran View Post
There is already an export feature if you read the docs and it does work easily with a spreadsheet. I have even seen someone recently specify to use the custom delimiter of the & on google sheets. I don't know how things have been done in the past with that delimiter but you are limited because of how the Lua saved variables work. It has been done the same way since the beginning and I'm not willing to change that.
I understand how the EXPORT feature of Master Merchant works and since it can not create a CSV file directly I have to go into MasterMerchant.lua, copy and paste the data I want into a text editor, remove all the Lua data formatting, save the file, open it in Excel, and choose the & symbol as a deliminator.

The process is a bit cumbersome to do manually and I know it is possible to create a Lua script to write a CSV file from a Saved Variable Lua files as I have done it with a simpler addon that recorded gold deposits into a guild bank for guild raffles.

I was hoping someone already had the code written, but I will eventually find the time to write it myself. I'll post the results when I am finished.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » LUA script to Extrtact Flat Data from Saved Variables


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