Note

Quick script that detects an object called Well Sample Bottle when it comes in a 1m range. Once it does, the script switches to the display state and sets the texture to sample. It then pauses for 5 minutes, sets the texture to 0f0d3af1-f8fb-d2e9-d9a7-98ab76724e0c and goes back to the default state.

This was used to create a camera-enabled microscope.

Code

object_detector.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
default {
    state_entry() {
        llSensorRepeat("Well Sample Bottle", "", ACTIVE|PASSIVE, 1, TWO_PI, 1);
    }
    sensor(integer num) {
        state display;
    }
}
 
state display {
    state_entry() {
        llSay(0, "You put a sample on a slide and the microscope displays the collected sample on the screen.");
        llSetTexture("sample", 3);
        llSetTimerEvent(300);
    }
    timer() {
        llSetTexture("0f0d3af1-f8fb-d2e9-d9a7-98ab76724e0c", 3);
        state default;
    }
}

secondlife/object_detector.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.