// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Morse word encoder // Not compiled or tested in-world // Setup: Owner-touch, then type up to 12 letters without spaces. // Stop / restore: Stop responding and the listener closes after 90 seconds, or remove/disable the script. Owner-touch restarts the exercise. // Notes: Owner-only local exercise; no prizes, visitor records, network service, or persistent scores. Uses international Morse A–Z only. Output is text, not audio or emergency signaling. // 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); } ask(string prompt) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),prompt,channel); llSetTimerEvent(90.0); } list codes=[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]; start() { ask("Enter 1-12 letters A-Z to encode as Morse."); } answer(string s) { s=llToUpper(s); integer length=llStringLength(s); if(length<1||length>12) { ask("Use 1-12 letters."); return; } list out; integer i; for(i=0;i