// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Ramp slope and length // Not compiled or tested in-world // Setup: Put in a spare prim you own. Edit RISE and RUN in metres. Touch for virtual-building measurements. // Stop / restore: Disable or remove the script. It only reports to its owner and does not change prim properties. Reset clears its temporary state. // Notes: RUN must be positive. Negative RISE reports a descending slope. These measurements do not establish accessibility or safety compliance. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Owner-only calculation; no scene changes. float RISE = 2.0; float RUN = 9.0; default { touch_start(integer detectedCount) { if (llDetectedKey(0) != llGetOwner()) return; if (RUN <= 0.0) { llOwnerSay("Horizontal run must be positive."); return; } llOwnerSay("Length: " + (string)llSqrt(RISE*RISE + RUN*RUN) + " m"); llOwnerSay("Angle: " + (string)(llAtan2(RISE,RUN)*RAD_TO_DEG) + " degrees; grade: " + (string)(100.0*RISE/RUN) + "%"); } changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); } }