// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Root orientation bookmarks // Not compiled or tested in-world // Setup: Put in a nonphysical root. Rotate manually, choose Capture A/B, then recall either bookmark. Home restores startup orientation. // Stop / restore: Use the Restore or Home action described in setup before removing or resetting if you want the startup appearance. Menu listeners expire after 45 seconds. // Notes: Local owner-only control. Saved snapshots live in script memory and are lost on reset. Bookmarks are rotations only; position and child-local transforms are not captured. Do not use on physical objects. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } menu(string prompt,list buttons) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llDialog(llGetOwner(),prompt,buttons,channel); llSetTimerEvent(45.0); } rotation home; rotation a; rotation b; init() { home=llGetRot(); a=home; b=home; } show() { menu("Root orientation bookmarks",["Capture A","Capture B","Recall A","Recall B","Home"]); } choose(string s) { if(llGetLinkNumber()>1||llGetStatus(STATUS_PHYSICS))return; if(s=="Capture A")a=llGetRot(); else if(s=="Capture B")b=llGetRot(); else if(s=="Recall A")llSetRot(a); else if(s=="Recall B")llSetRot(b); else if(s=="Home")llSetRot(home); else return; show(); } default { state_entry() { init(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; close(); show(); } listen(integer ch,string name,key id,string message) { if(!handle||ch!=channel||id!=llGetOwner())return; choose(message); } timer() { close(); } changed(integer change) { if(change&CHANGED_OWNER)llResetScript(); } }