diff --git a/src/main/java/carpet/script/CarpetScriptServer.java b/src/main/java/carpet/script/CarpetScriptServer.java index c7bb9516..0364945e 100644 --- a/src/main/java/carpet/script/CarpetScriptServer.java +++ b/src/main/java/carpet/script/CarpetScriptServer.java @@ -48,6 +48,7 @@ public class CarpetScriptServer public CarpetScriptServer() { + ScriptHost.systemGlobals.clear(); events = new CarpetEventServer(); modules = new HashMap<>(); tickStart = 0L; diff --git a/src/main/java/carpet/script/Expression.java b/src/main/java/carpet/script/Expression.java index 9bcc34e5..b6be4cbf 100644 --- a/src/main/java/carpet/script/Expression.java +++ b/src/main/java/carpet/script/Expression.java @@ -2681,6 +2681,7 @@ public class Expression *
task_completed(task)Returns true if task has completed, or false otherwise.
* + *lower(expr), upper(expr), title(expr)Scarpet runs apps in isolation. The can share code via use of shared libraries, but each library that is imported + * to each app is specific to that app. Apps can store and fetch state from disk, but its restricted to specific locations + * meaning apps cannot interact via disk either. To facilitate communication for interappperability, scarpet hosts its own + * key-value storage that is shared between all apps currently running on the host, providing methods for getting + * an associated value with optional setting it if not present, and an operation of modifying a content of a system global + * value.
+ *system_variable_get(key, default_value ?)Returns the variable from the system shared key-value storage keyed with a key value, optionally
+ * if value is not present, and default expression is provided, sets a new value to be associated with that key
system_variable_set(key, new_value)Returns the variable from the system shared key-value storage keyed with a key value, and sets
+ * a new mapping for the key