// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Morse audio beacon // Not compiled or tested in-world // Setup: Add a clean tone loop. Edit SYMBOLS using dot, dash and spaces; owner-touch starts/cancels. // 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. Each symbol is a separate loop interval; spaces add word gaps. This is approximate demonstration timing, not radio signaling. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer active; string SYMBOLS="... --- ..."; integer index; integer sounding; float due; stop() { active=FALSE; llSetTimerEvent(0.0); llStopSound(); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(active) { stop(); return; } active=TRUE; if(llGetInventoryType("tone")!=INVENTORY_SOUND) { stop(); return; } index=0; sounding=FALSE; due=llGetTime(); if(active)llSetTimerEvent(0.1); } timer() { if(active) { if(llGetTime()=llStringLength(SYMBOLS)) { stop(); return; } string symbol=llGetSubString(SYMBOLS,index,index); ++index; if(symbol=="."||symbol=="-") { float duration=0.25; if(symbol=="-")duration=0.75; llLoopSound("tone",0.1); sounding=TRUE; due=llGetTime()+duration; } else due=llGetTime()+0.75; } } }