// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Snooze a private review reminder // Not compiled or tested in-world // Setup: Touch to arm a 60-second review reminder. Snooze delays it another 60 seconds; touch while armed cancels. // 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. If the dialog expires there is no further notification until you touch to start again. Maximum three snoozes per run. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer active; integer handle; integer channel; integer expires; integer due; integer snoozes; closeInput() { if(handle)llListenRemove(handle); handle=0; } schedule() { if(active || handle)llSetTimerEvent(1.0); else llSetTimerEvent(0.0); } beginInput() { closeInput(); channel=-10000-(integer)llFrand(1000000000); handle=llListen(channel,"",llGetOwner(),""); expires=llGetUnixTime()+45; schedule(); } menu(string prompt,list buttons) { beginInput(); llDialog(llGetOwner(),prompt,buttons,channel); } default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; if(active) { active=FALSE; closeInput(); llOwnerSay("Review reminder cancelled."); } else { closeInput(); snoozes=0; active=TRUE; due=llGetUnixTime()+60; llOwnerSay("Review reminder in 60 seconds."); } schedule(); } listen(integer c,string name,key speaker,string input) { if(c!=channel || speaker!=llGetOwner() || !handle)return; closeInput(); if(llStringLength(input)>200) { llOwnerSay("Reply is too long."); schedule(); return; } if(input=="Snooze" && snoozes<3) { ++snoozes; due=llGetUnixTime()+60; active=TRUE; llOwnerSay("Snoozed."); } else if(input=="Done")llOwnerSay("Review reminder dismissed."); schedule(); } timer() { if(handle && llGetUnixTime()>=expires) { closeInput(); llOwnerSay("Input expired."); } if(active && llGetUnixTime()>=due) { active=FALSE; if(snoozes<3)menu("Review your build now?",["Done","Snooze"]); else menu("Final reminder: review your build.",["Done"]); } schedule(); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }