// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Named build position bookmarks // Not compiled or tested in-world // Setup: Place in your own object and touch. Enter save|name, get|name, or list. Up to eight bookmarks. // Stop / restore: Remove or reset to erase session data. Input listeners close after one reply or after 45 seconds. // Notes: Data lives only in script memory and is lost on reset. No visitors are logged and no external requests are sent. Stores region name and position only; never teleports or moves an object. Useful for your own build notes, not tracking people. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. list names; list places; integer handle; integer channel; closeInput() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0); } respond(string input) { input=llStringTrim(input,STRING_TRIM); if(llStringLength(input)>200) { llOwnerSay("Use at most 200 characters."); return; } if(input=="list") { llOwnerSay(llDumpList2String(names,", ")); return; } list p=llParseStringKeepNulls(input,["|"],[]); if(llGetListLength(p)!=2 || llList2String(p,1)=="") { llOwnerSay("Use save|name or get|name."); return; } string name=llList2String(p,1); integer index=llListFindList(names,[name]); if(llList2String(p,0)=="get") { if(index==-1)llOwnerSay("Unknown bookmark."); else llOwnerSay(name+": "+llList2String(places,index)); return; } if(llList2String(p,0)!="save") { llOwnerSay("Unknown command."); return; } string place=llGetRegionName()+" "+(string)llGetPos(); if(index==-1) { if(llGetListLength(names)>=8) { llOwnerSay("Bookmark list full."); return; } names += [name]; places += [place]; } else places=llListReplaceList(places,[place],index,index); llOwnerSay("Position bookmarked."); } default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; closeInput(); channel=-10000-(integer)llFrand(1000000000); handle=llListen(channel,"",llGetOwner(),""); llSetTimerEvent(45); llTextBox(llGetOwner(),"Enter save|name, get|name, or list. Up to eight bookmarks.",channel); } listen(integer c,string name,key speaker,string input) { if(c!=channel || speaker!=llGetOwner())return; closeInput(); respond(input); } timer() { closeInput(); llOwnerSay("Input closed."); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }