// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Remember the digit sequence // Not compiled or tested in-world // Setup: Owner-touch a spare prim. The digits show for four seconds; a text box then asks for the same sequence. // Stop / restore: Wait for a result or owner-touch to restart; remove and clear text when done. Listener expires after 30 seconds. // Notes: The answer remains in viewer history only if the viewer records displayed text; this is a casual memory exercise, not a secure challenge. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. string sequence; integer channel; integer handle; integer phase; close() { if (handle) llListenRemove(handle); handle = 0; llSetTimerEvent(0.0); } default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; close(); sequence = ""; integer i; for (i = 0; i < 4; ++i) sequence += (string)((integer)llFrand(10.0)); phase = 1; llSetText(sequence, <0.8, 1.0, 0.8>, 1.0); llSetTimerEvent(4.0); } timer() { if (phase == 1) { phase = 2; llSetText("What were the digits?", <0.8, 0.9, 1.0>, 1.0); channel = -1000 - (integer)llFrand(1000000.0); handle = llListen(channel, "", llGetOwner(), ""); llTextBox(llGetOwner(), "Enter the four digits, including any leading zero.", channel); llSetTimerEvent(30.0); } else { close(); phase = 0; llSetText("Time expired. Touch to retry.", <0.8, 0.8, 0.8>, 1.0); } } listen(integer received, string name, key id, string message) { if (received != channel || id != llGetOwner() || phase != 2) return; close(); phase = 0; if (llStringTrim(message, STRING_TRIM) == sequence) llSetText("Correct! Touch for another.", <0.6, 1.0, 0.6>, 1.0); else llSetText("The sequence was " + sequence + ". Touch to retry.", <1.0, 0.8, 0.6>, 1.0); } changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); } }