// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Read typed JSON settings // Not compiled or tested in-world // Setup: Edit CONFIG and touch as owner. Requires simulator support for LSL JSON functions. // Stop / restore: Remove or disable the script. It does not change the build. // Notes: Malformed or missing values produce a helpful report. JSON support and behavior need checking on your OpenSim version. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. string CONFIG = "{\"label\":\"Garden\",\"interval\":30}"; default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; if (llJsonValueType(CONFIG, ["label"]) != JSON_STRING || llJsonValueType(CONFIG, ["interval"]) != JSON_NUMBER) { llOwnerSay("Expected a string label and a numeric interval."); return; } string label = llJsonGetValue(CONFIG, ["label"]); float interval = (float)llJsonGetValue(CONFIG, ["interval"]); if (interval < 1.0 || interval > 3600.0) { llOwnerSay("Interval must be 1 through 3600 seconds."); return; } llOwnerSay("Label: " + label + " / interval: " + (string)interval); } changed(integer flags) { if (flags & CHANGED_OWNER) llResetScript(); } }