// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Incoprea
// Check two-column uniqueness
// Not compiled or tested in-world
// Setup: Edit ROWS as category,name,value triples; touch as owner.
// Stop / restore: Remove or disable; it only reports locally to the owner.
// Notes: Fields are compared separately, so embedded delimiters cannot create accidental combined-key collisions.
// License: see LICENSE in this distribution.
// Original Incoprea example. MIT.
list ROWS=["Lights","Lamp","blue","Seats","Lamp","small","Lights","Lamp","red"];
default
{
    touch_start(integer touches)
    {
        if(llDetectedKey(0)!=llGetOwner())return;
        if(llGetListLength(ROWS)%3)
        {
            llOwnerSay("Incomplete triple.");
            return;
        }
        integer i;
        integer j;
        for(i=0;i<llGetListLength(ROWS);i+=3)for(j=0;j<i;j+=3)if(llList2String(ROWS,i)==llList2String(ROWS,j) && llList2String(ROWS,i+1)==llList2String(ROWS,j+1))llOwnerSay("Repeated category/name at rows "+(string)(j/3)+" and "+(string)(i/3));
        llOwnerSay("Composite-key check complete.");
    }
    changed(integer flags)
    {
        if(flags & CHANGED_OWNER)llResetScript();
    }
}
