// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Format a byte count // Not compiled or tested in-world // Setup: Edit BYTES and touch as owner. // Stop / restore: Remove or disable; results are reported only to the owner. // Notes: Binary units use 1024, not 1000. This formats a number and does not measure an asset, file download, or script allocation. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer BYTES=1536000; default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; if(BYTES<0) { llOwnerSay("Bytes cannot be negative."); return; } if(BYTES<1024)llOwnerSay((string)BYTES+" bytes"); else if(BYTES<1048576)llOwnerSay((string)((float)BYTES/1024.0)+" KiB"); else llOwnerSay((string)((float)BYTES/1048576.0)+" MiB"); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }