// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Undo completed steps after a failure // Not compiled or tested in-world // Setup: Place in a spare owned prim. Touch once to run three steps, with the third deliberately failing. Owner touch runs the local demonstration. // Stop / restore: Disable/remove. No external requests or scene changes occur; reset clears memory. // Notes: Compensation is not true atomic rollback. Each simulated step only prints owner chat and appends a reversible label. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Local owner-only protocol laboratory. list undo; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; undo=[]; llOwnerSay("Step1: reserve sample slot."); undo+=["release sample slot"]; llOwnerSay("Step2: stage sample label."); undo+=["discard staged label"]; llOwnerSay("Step3: simulated failure; compensating."); integer i; for(i=llGetListLength(undo)-1;i>=0;--i)llOwnerSay("Undo: "+llList2String(undo,i)); undo=[]; } }