// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Measure a waypoint route // Not compiled or tested in-world // Setup: Edit POINTS using coordinates from one consistent coordinate system; touch as owner. // Stop / restore: Remove or disable the script. It does not change the build. // Notes: It does not move an object or find a walkable route. It ignores obstacles and does not automatically close a loop. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. list POINTS = [<0.0, 0.0, 0.0>, <3.0, 0.0, 0.0>, <3.0, 4.0, 0.0>]; default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; integer total = llGetListLength(POINTS); if (total < 2) { llOwnerSay("Add at least two waypoints."); return; } float distance = 0.0; integer i; for (i = 1; i < total; ++i) distance += llVecDist(llList2Vector(POINTS, i - 1), llList2Vector(POINTS, i)); llOwnerSay((string)(total - 1) + " segments, total length " + (string)distance + " meters."); } changed(integer flags) { if (flags & CHANGED_OWNER) llResetScript(); } }