// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Priority sound cue receiver // Not compiled or tested in-world // Setup: Add notice, warning and complete clips, each shorter than three seconds. Root named cue_controller sends code 8052 with those names. Owner-touch arms/disarms. // Stop / restore: Owner-touch the script prim to stop an active session before removing or resetting it. Loop state can survive script removal; use Stop sound in this prim if necessary. // Notes: Use licensed sounds in this prim. Audio is nearby, not private. Timer timing and asset loading are approximate; no sample synchronization is promised. Priority is authored: notice=1, complete=2, warning=3. A three-second lock expires independently of exact clip duration. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer armed; integer priority; float until; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; armed=!armed; priority=0; llStopSound(); llSetTimerEvent(0.0); } link_message(integer sender,integer code,string s,key data) { if(!armed||sender!=1||llGetLinkName(1)!="cue_controller"||code!=8052)return; integer p=llListFindList(["notice","complete","warning"],[s])+1; if(!p||llGetInventoryType(s)!=INVENTORY_SOUND)return; if(llGetTime()>=until)priority=0; if(p