// ============================================================ // ANTI-CLONE GUARDIAN v1.0 // IMAGE Framework / Ozone MiniVerse Engine Stack // OpenSim 0.9.2.1 Yeti / Mono / XEngine / BulletSim / OSSL // By Spax Orion and Dirty Helga Released under: CC BY-NC // https://creativecommons.org/licenses/by-nc/4.0/ // ============================================================ // PURPOSE: // Detects if the avatar wearing/containing this script is // an unauthorized NPC clone. If detected, the NPC delivers // its termination statement and is immediately removed. // // PLACEMENT: // Inside any mesh object worn by or attached to your avatar. // Fires on rez and on attach to catch both scenarios. // ============================================================ // SECTION: CONFIGURATION // ============================================================ // Channel for optional region broadcast of the clone event. // Set to 0 to use open chat. Set to -1 to disable broadcast entirely. integer ALERT_CHANNEL = 0; // Time in seconds to pause before removal, allowing the // statement to be heard/seen before the NPC vanishes. // Keep short. Drama does not require a monologue. float REMOVAL_DELAY = 2.0; // ============================================================ // SECTION: CONSTANTS // ============================================================ // The termination statement the NPC will say before removal. // Screenshot-survivable. Professionally hostile. string TERMINATION_STATEMENT = "This avatar is NOT AUTHORIZED for CLONING. " + "Permission to remove illegal NPC from the simulator GRANTED."; // ============================================================ // SECTION: RUNTIME VARIABLES // ============================================================ // Latched flag to prevent double-fire on both on_rez and attach // triggering in the same session. integer gGuardianFired = FALSE; // ============================================================ // SECTION: HELPERS // ============================================================ // checkAndExecute() // Core logic gate. Asks OSSL if the current owner is an NPC. // If yes: speaks the termination statement, waits, then removes. // Falls back to llDie() if osNpcRemove is unavailable. checkAndExecute() { // Guard against double-fire if (gGuardianFired == TRUE) { return; } key ownerKey = llGetOwner(); //NOW FOR THE REALLY FUN STUFF! // osIsNpc() — High threat OSSL. Confirm enabled on your grid. if (osIsNpc(ownerKey) == TRUE) { gGuardianFired = TRUE; // NPC speaks its own termination notice. // This fires from the object, appearing as object chat, // which is visible and screenshot-legible. osNpcSay(ownerKey, ALERT_CHANNEL, TERMINATION_STATEMENT); //=============================================================================== // Add your own punishments here if the NPC reprimand is not enough. // ossl has other tools you can exploit while your unauthorized clone is inworld. // http://opensimulator.org/wiki/Category:OSSL_Functions // By changing permissions without consent, bad actor selected the consequences. // DO NOT BE MEAN, FOLKS, let your moral compass be your guide. //=============================================================================== // Brief dramatic pause. Just enough to land. llSleep(REMOVAL_DELAY); // osNpcRemove() — High threat OSSL. // If this fails (permissions), llDie() kills the script // object as a fallback denial-of-function measure. osNpcRemove(ownerKey); // // Fallback: if osNpcRemove did not terminate execution, // at minimum kill this script object. llDie(); } // If owner is NOT an NPC, do nothing. Silent pass. // Legitimate wearers are never affected. } // ============================================================ // SECTION: STATES // ============================================================ default { // ------------------------------------------------------- // Fires when the object is rezzed into the world. // Covers direct rez scenarios. // ------------------------------------------------------- on_rez(integer startParam) { checkAndExecute(); } // ------------------------------------------------------- // Fires when the object is attached to an avatar. // Covers worn-attachment scenarios. // ------------------------------------------------------- attach(key attachedAgent) { // attachedAgent is NULL_KEY on detach; only act on attach. if (attachedAgent != NULL_KEY) { checkAndExecute(); } } // ------------------------------------------------------- // State entry resets the latch for clean re-use. // ------------------------------------------------------- state_entry() { gGuardianFired = FALSE; } } // ============================================================ // END: AntiClone_v1.lsl // ============================================================