// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Sort a strided price table // Not compiled or tested in-world // Setup: Edit the alternating price/name list and touch as owner. // Stop / restore: Remove or disable the script. It does not change the build. // Notes: Every record must contain exactly two elements. This demonstrates local data sorting; it never takes or transfers money. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. list PRICES = [12.5, "Lantern", 5.0, "Cup", 8.0, "Planter"]; default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; list sorted = llListSort(PRICES, 2, TRUE); integer i; for (i = 0; i < llGetListLength(sorted); i += 2) llOwnerSay(llList2String(sorted, i + 1) + ": " + (string)llList2Float(sorted, i)); } changed(integer flags) { if (flags & CHANGED_OWNER) llResetScript(); } }