// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Check local link-message ordering // Not compiled or tested in-world // Setup: Touch as owner to run one bounded probe. // Stop / restore: Remove or reset the script to stop the diagnostic. No build properties are changed. // Notes: Diagnostic only. It does not assume that unrelated scripts share a global event order. Reports completion or a five-second timeout. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer expected; integer active; key token=NULL_KEY; default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner() || active)return; active=TRUE; expected=0; token=llGenerateKey(); llSetTimerEvent(5); integer i; for(i=0;i<10;++i)llMessageLinked(LINK_THIS,71003,(string)i,token); } link_message(integer sender,integer code,string text,key id) { if(!active || code!=71003 || id!=token)return; integer value=(integer)text; if(value!=expected) { llOwnerSay("Order mismatch: expected "+(string)expected+", received "+text); active=FALSE; llSetTimerEvent(0); return; } ++expected; if(expected==10) { active=FALSE; llSetTimerEvent(0); llOwnerSay("All ten self-messages arrived in order."); } } timer() { active=FALSE; llSetTimerEvent(0); llOwnerSay("Probe timed out after "+(string)expected+" messages."); } }