// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Fit a loop by distributing dwell time // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set positive cue DURATIONS and TARGET_TOTAL at least their sum. Owner touch runs a bounded local calculation. // Stop / restore: Disable/remove. No travel, publication, payments or external operations occur. // Notes: All extra time is distributed equally; transition durations are assumed already included. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Local planning demonstration. list DURATIONS=[2.0,3.0,4.0]; float TARGET_TOTAL=15.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(DURATIONS); if(n==0) { llOwnerSay("No cues."); return; } float total; integer i; for(i=0;i