// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Verify the reported notecard line-count boundary // Not compiled or tested in-world // Setup: Use a spare owned test object. Add a short notecard named testcard and touch. // Stop / restore: Disable/remove. Tests report privately and do not change visual prim properties. Any temporary timer stops at completion or timeout. // Notes: Notecard changes during the test can invalidate the expectation. The count response and EOF query are separately correlated. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Runtime verification, not pre-certified behavior. key request; integer phase; key originalAsset; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||phase)return; if(llGetInventoryType("testcard")!=INVENTORY_NOTECARD) { llOwnerSay("Add testcard notecard."); return; } originalAsset=llGetInventoryKey("testcard"); phase=1; request=llGetNumberOfNotecardLines("testcard"); llSetTimerEvent(15.0); } dataserver(key id,string data) { if(id!=request||phase==0)return; if(originalAsset!=llGetInventoryKey("testcard")) { phase=0; request=NULL_KEY; llSetTimerEvent(0.0); llOwnerSay("Notecard changed; test canceled."); return; } if(phase==1) { integer count=(integer)data; if(count<0) { phase=0; llSetTimerEvent(0.0); return; } phase=2; request=llGetNotecardLine("testcard",count); } else { phase=0; request=NULL_KEY; llSetTimerEvent(0.0); llOwnerSay("EOF at line-count boundary="+(string)(data==EOF)); } } timer() { phase=0; request=NULL_KEY; llSetTimerEvent(0.0); llOwnerSay("Notecard test timed out."); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }