// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Hold-to-confirm teaching pattern // Not compiled or tested in-world // Setup: Put in a spare prim you own. Press and hold the prim, then release. Owner chat reports accepted or too short. // Stop / restore: Disable or remove the script. It only reports to its owner and does not change prim properties. Reset clears its temporary state. // Notes: Viewer interaction and lost touch events can vary. This measures event times, not a physical button; use a copy for testing. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Owner-only calculation; no scene changes. integer holding; float began; default { touch_start(integer detectedCount) { if (llDetectedKey(0) != llGetOwner()) return; holding = TRUE; began = llGetTime(); llOwnerSay("Hold for at least two seconds, then release."); } changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); } touch_end(integer count) { if (llDetectedKey(0) != llGetOwner() || !holding) return; holding = FALSE; float elapsed = llGetTime()-began; if (elapsed >= 2.0) llOwnerSay("Hold confirmed: " + (string)elapsed + " seconds."); else llOwnerSay("Released too soon: " + (string)elapsed + " seconds."); } }