// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Convert a simple identifier style // Not compiled or tested in-world // Setup: Edit the sample inputs, then touch as owner. // Stop / restore: Remove or disable. All transformations are previews in owner chat. // Notes: Restricted to ASCII letters, digits, and underscore. Acronym runs are split mechanically and are not inferred as words. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. string INPUT="gardenLampCount"; string MODE="snake"; default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; string result=""; integer i; integer upperNext; for(i=0;i=65 && code<=90) { if(i>0)result+="_"; result+=llToLower(c); } else result+=c; } else if(MODE=="camel") { if(c=="_")upperNext=TRUE; else { if(upperNext)c=llToUpper(c); else if(result=="")c=llToLower(c); result+=c; upperNext=FALSE; } } else { llOwnerSay("Mode must be snake or camel."); return; } } llOwnerSay(result); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }