View Single Post
01/15/16, 05:35 PM   #11
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by vandel212 View Post
So here is what I am doing. I'm gathering data and then having another application outside of ESO look at this then do some processing. So my workflow thus far is, go in game, do some stuff, have it save all the information, and reload the ui so it actually saves to the file. Then the external program processes the saved variables.

That works as expected. I do not want the external program to process the information again, ...
If I understand this correctly, why not just set a flag in your saved variables?
Lua Code:
  1. mySavedVars= {
  2.    exportData = false,
  3.    
  4.    -- whatever other data you have
  5. }

Then create a button or a slash command that sets the flag & reloads the ui.
Lua Code:
  1. SLASH_COMMANDS["/backupdata"]   = function ()
  2.    -- Set flag so data is backed up
  3.    mySavedVars.exportData = true
  4.    ReloadUI("ingame")
  5. end

Then when the UI reloads reset the saved variable to false so it won't backup the data again.
Lua Code:
  1. mySavedVars.exportData = false

Then all you have to do is have your external program check for the exportData flag and only process it if it is true.

Or you could create a backup table in your saved vars. Use a custom reloadUI slash command like above and before it reloads the ui copy all of the data you want to backup into the backup table
Lua Code:
  1. mySavedVars = {
  2.    backupData = {}
  3.  
  4.    --- other stuff
  5. }
and then on player activation wipe out the bakcupData table. Since the backupData table is just a copy you would still retain all of the original data in your saved vars. Then just have your external program only copy whats in the backupData table.

Either way when the game is reloaded normally either the exportData flag is false or the backupData table is empty, depending on which method you use, no new data will get exported and you will still retain the original data in saved vars.

Last edited by circonian : 01/15/16 at 05:44 PM.
  Reply With Quote