// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Own-object terrain-clearance monitor // Not compiled or tested in-world // Setup: Owner-touch arms a one-second check on a demonstration object. // Stop / restore: Owner-touch to disarm before removing. No physical status or movement is changed. // Notes: No avatar surveillance or visitor history. Center clearance is not bottom clearance. Mesh floors are excluded; this does not stop a fall. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer armed; integer low; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; armed=!armed; if(armed) { low=FALSE; llSetTimerEvent(1.0); llOwnerSay("Monitor armed."); } else { llSetTimerEvent(0.0); llOwnerSay("Monitor off."); } } timer() { if(!armed)return; vector p=llGetPos(); float c=p.z-llGround(ZERO_VECTOR); if(!low&&c<0.5) { low=TRUE; llOwnerSay("Object center is within 0.5 m of terrain."); } else if(low&&c>0.8) { low=FALSE; llOwnerSay("Terrain clearance recovered."); } } }