// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Request a small batch of numbered labels // Not compiled or tested in-world // Setup: Touch and enter prefix|count, with count 1–12. // 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 inventory or object names are changed. Prefix is capped at 30 characters and the count uses strict decimal digits. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer active; integer handle; integer channel; integer expires; 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(); } ask(string prompt) { beginInput(); llTextBox(llGetOwner(),prompt,channel); } default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; ask("Enter prefix|count, for example Panel-|5."); 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; } list p=llParseStringKeepNulls(input,["|"],[]); string prefix=llList2String(p,0); string countText=llList2String(p,1); integer valid=llGetListLength(p)==2 && prefix!="" && llStringLength(prefix)<=30 && llStringLength(countText)>=1 && llStringLength(countText)<=2; integer i; for(i=0;i12)llOwnerSay("Use prefix|count with count 1–12."); else for(i=1;i<=total;++i)llOwnerSay(prefix+(string)i); schedule(); } timer() { if(handle && llGetUnixTime()>=expires) { closeInput(); llOwnerSay("Input expired."); } schedule(); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }