table that persists with the showfile

BECOME PART OF THE COMMUNITY - Sign up here
  • As stated in the title I'd like to have a table with data persist even after reloading the ui, restarting the console or even changing the desk.

    I've thought about serializing the data and storing it somewhere where it does persist with the showfile, like a macro, and then check on plugin load whether the table is still there and if not loads it back in from that macro. As that would be a pretty hacky solution I'd like to find a proper way to do this but couldn't find much in this forum or the docs.

    Any tips or hints in the right direction are highly appreciated.

  • Hi,


    What I do with critical variables in LUA is store them as Global Variables in MA and then get those variables when I need them from LUA. This way it gets stored with the showfile.

    Best,

    Maxwell

  • To store a table as a variable, have a look at lua table serialization.

    MA won't accept a lua table as the input to a variable. To get around this you can use serialization to "flatten" the table and convert it to text, which is a valid input for a variable. You'll need to de-serialize the variable to rebuild the table when you bring it back into lua.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!