// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Incoprea
// Compare two configuration schemas
// Not compiled or tested in-world
// Setup: Edit REQUIRED and PROVIDED; touch as owner.
// Stop / restore: Remove or disable; it only reports locally to the owner.
// Notes: Works on names only and does not inspect values. Duplicate input keys are outside this simple set comparison; use the record-key validator first.
// License: see LICENSE in this distribution.
// Original Incoprea example. MIT.
list REQUIRED=["title","version","color"];
list PROVIDED=["title","colour","debug"];
default
{
    touch_start(integer touches)
    {
        if(llDetectedKey(0)!=llGetOwner())return;
        integer i;
        for(i=0;i<llGetListLength(REQUIRED);++i)
        {
            string field=llList2String(REQUIRED,i);
            if(llListFindList(PROVIDED,[field])==-1)llOwnerSay("Missing required key: "+field);
        }
        for(i=0;i<llGetListLength(PROVIDED);++i)
        {
            string field=llList2String(PROVIDED,i);
            if(llListFindList(REQUIRED,[field])==-1)llOwnerSay("Unknown supplied key: "+field);
        }
    }
    changed(integer flags)
    {
        if(flags & CHANGED_OWNER)llResetScript();
    }
}
