// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Place small items on bounded shelves // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set positive widths no larger than CAPACITY; at most twenty items. Touch for owner-only output. // Stop / restore: Remove/disable. The script calculates only; no scene properties change. // Notes: One-dimensional width packing with no gaps; first-fit is a heuristic and may use more shelves than an optimal arrangement. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. list WIDTHS=[3.0,2.0,4.0,1.5,2.5,1.0]; float CAPACITY=6.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(WIDTHS); if(n>20||CAPACITY<=0.0) { llOwnerSay("Invalid capacity/count."); return; } list used; integer i; for(i=0;iCAPACITY) { llOwnerSay("Invalid item width."); return; } integer shelf=0; integer placed=FALSE; while(shelf