Table of Contents

Shortnote

The following example is an illustration of randomness entropy and statistics and consists of script that will continuously rez and object called Ying-Yang-Yung from inventory and will set it to temporary.

The script scans the vicinity for the Ying-Yang-Yung object and makes sure that only one copy is rezzed at a time. The purpose of this system is to rez objects with the temporary flag so that they do not occupy primitives.

Setup

  1. Create a primitive and drop and object named Ying-Yang-Yung inside the primitive.
  2. Drop the script inside the same primitive.

Code

false_rezzer.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
vector REZ_DELTA = < 0, 0, 1 > ;
 
default {
    state_entry() {
        vector size = llGetScale();
        llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos() + REZ_DELTA, ZERO_VECTOR, ZERO_ROTATION, 0);
 
        // See http://grimore.org/secondlife:randomness_entropy_and_statistics
        // for a description of the time between scans. Take out error .1s for object rez.
        llSensorRepeat("Ying-Yang-Yung", "", ACTIVE | PASSIVE, 2 * size.z, PI_BY_TWO / 2, 59.865625));
    }
 
    sensor(integer num) {
        llOwnerSay("oops");
    }
 
    no_sensor() {
        // Magic 11: See http://grimore.org/secondlife:randomness_entropy_and_statistics
        llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos() + REZ_DELTA, ZERO_VECTOR, ZERO_ROTATION, 0);
    }
}