1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Updated Storage (markdown)

Robert Beekman 2017-04-23 14:40:06 +02:00
parent 41011d9464
commit aa687e7946

@ -29,4 +29,10 @@ GlobalStorage["favoriteColor"] = "blue";
-- Retrieve the value at a later time
local favoriteColor = GlobalStorage["favoriteColor"];
```
```
## Notes
A few things to keep in mind when storing values
* You can only store [primitive types](https://www.tutorialspoint.com/lua/lua_data_types.htm) and tables (which can also only contain primitive types). If you try to store something else Artemis will not save any of your settings.
* If you try to access a value that has never been set before, you'll get ```nil``` so be sure to check for that, especially when [concatenating](https://www.lua.org/pil/3.4.html) strings.
* Values are read from disk when the script is loaded and stored to disk when the script is unloaded.