// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Measure your own touches in a short fixed window // Not compiled or tested in-world // Setup: The first touch starts the window and counts as one. Further owner touches increment until the deadline. // Stop / restore: Remove, disable, or reset to stop timers and discard session state. Temporary input listeners expire after 45 seconds. // Notes: Only the current owner can control this example. Timing is approximate and can be delayed by simulator load. No visitor identities or events are retained. Event delivery and input-device behavior affect the observed count. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer active; integer handle; integer channel; integer expires; integer touchesInWindow; integer due; closeInput() { if(handle)llListenRemove(handle); handle=0; } schedule() { if(active || handle)llSetTimerEvent(1.0); else llSetTimerEvent(0.0); } default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; if(!active) { active=TRUE; due=llGetUnixTime()+10; touchesInWindow=1; llOwnerSay("Ten-second owner touch window started."); } else if(llGetUnixTime()200) { llOwnerSay("Reply is too long."); schedule(); return; } schedule(); } timer() { if(handle && llGetUnixTime()>=expires) { closeInput(); llOwnerSay("Input expired."); } if(active && llGetUnixTime()>=due) { active=FALSE; llOwnerSay("Owner touches in window: "+(string)touchesInWindow); } schedule(); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }