mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Updated Storage (markdown)
parent
41011d9464
commit
aa687e7946
@ -30,3 +30,9 @@ GlobalStorage["favoriteColor"] = "blue";
|
|||||||
-- Retrieve the value at a later time
|
-- Retrieve the value at a later time
|
||||||
local favoriteColor = GlobalStorage["favoriteColor"];
|
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.
|
||||||
Loading…
x
Reference in New Issue
Block a user