// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Check scale values through a JSON numeric record // Not compiled or tested in-world // Setup: Use a spare owned test object. Resize the test prim, then touch. // Stop / restore: Disable/remove. Tests report privately and do not change visual prim properties. Any temporary timer stops at completion or timeout. // Notes: This checks field retrieval and numerical roundtrip for live dimensions; it does not preserve original textual formatting. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Runtime verification, not pre-certified behavior. default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; vector size=llGetScale(); string document=llList2Json(JSON_OBJECT,["x",size.x,"y",size.y,"z",size.z]); if(document==JSON_INVALID) { llOwnerSay("JSON construction failed."); return; } vector restored=<(float)llJsonGetValue(document,["x"]),(float)llJsonGetValue(document,["y"]),(float)llJsonGetValue(document,["z"])>; float error=llVecDist(size,restored); llOwnerSay("Scale JSON pass="+(string)(error<0.001)+" error="+(string)error+" record="+document); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }