// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Watch component role names during a test // Not compiled or tested in-world // Setup: Put in your own rezzed test object. Put in the root of a rezzed linkset with2–32 actual prims. Owner-touch starts a thirty-sample session; touch again ends early. // Stop / restore: Automatically stops after thirty samples. Disable/remove to stop; no scene properties are changed. // Notes: Stops when link keys change, rather than confusing relinked components. Names are only read; reports contain link numbers and change counts. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Test on a spare copy first. integer active; integer samples; float began; list keys; list names; list counts; integer total; finish() { llSetTimerEvent(0.0); active=FALSE; integer i; for(i=0;i0)llOwnerSay("Link "+(string)(i+2)+" name transitions="+(string)llList2Integer(counts,i)); llOwnerSay("Component-name watch finished."); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(active) { finish(); return; } samples=0; began=llGetTime(); if(llGetAttached()||llGetLinkNumber()>1)return; total=llGetObjectPrimCount(llGetKey()); if(total<2||total>32)return; keys=[]; names=[]; counts=[]; integer i; for(i=2;i<=total;++i) { keys += [llGetLinkKey(i)]; names += [llGetLinkName(i)]; counts += [0]; } active=TRUE; llSetTimerEvent(1.0); llOwnerSay("Measurement session started."); } timer() { if(!active)return; ++samples; if(llGetObjectPrimCount(llGetKey())!=total) { llOwnerSay("Prim count changed; stopped."); finish(); return; } integer i; for(i=2;i<=total;++i) { integer at=i-2; if(llGetLinkKey(i)!=llList2Key(keys,at)) { llOwnerSay("Link identity changed; stopped."); finish(); return; } string name=llGetLinkName(i); if(name!=llList2String(names,at)) { counts=llListReplaceList(counts,[llList2Integer(counts,at)+1],at,at); names=llListReplaceList(names,[name],at,at); } } if(samples>=30)finish(); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }