// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Keyframed pause and resume console // Not compiled or tested in-world // Setup: Put in the nonphysical unattached root whose KFM motion you intend to control. Owner-touch opens a menu. // Stop / restore: Choose Clear to remove the motion. Pause retains the path for a later Resume; it does not clear or restore position. // Notes: Do not change link topology, attachment state or physics while running. Selection can pause simulator motion. One-shot examples keep their armed flag until the next owner touch clears it, even after the path finishes; they do not infer completion from wall-clock timers. KFM is an object property shared by scripts. This console does not know the original route; disable controllers that automatically restart it. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||llGetLinkNumber()>1||llGetAttached()||llGetStatus(STATUS_PHYSICS))return; close(); channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); llDialog(llGetOwner(),"Control existing keyframed motion",["Pause","Resume","Clear"],channel); llSetTimerEvent(30.0); } listen(integer ch,string name,key id,string s) { if(!handle||ch!=channel||id!=llGetOwner())return; close(); if(llGetLinkNumber()>1||llGetAttached()||llGetStatus(STATUS_PHYSICS))return; if(s=="Pause")llSetKeyframedMotion([],[KFM_COMMAND,KFM_CMD_PAUSE]); else if(s=="Resume")llSetKeyframedMotion([],[KFM_COMMAND,KFM_CMD_PLAY]); else if(s=="Clear")llSetKeyframedMotion([],[]); } timer() { close(); } }