// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Cycle through dwell, travel, dwell and return // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set positive TRAVEL, nonnegative HOLD and ELAPSED. Owner touch prints calculations only. // Stop / restore: Disable/remove. No prim motion or appearance is changed. // Notes: The duration of a whole cycle is2*(travel+hold). Endpoints remain stationary during dwell phases. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Motion planning only. float TRAVEL=2.0; float HOLD=1.0; float ELAPSED=4.5; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(TRAVEL<=0.0||HOLD<0.0) { llOwnerSay("Invalid timing."); return; } float period=2.0*(TRAVEL+HOLD); float t=ELAPSED-period*llFloor(ELAPSED/period); float p; string phase; if(t