Table of Contents

Shortnote

The following is a greeter script that will pop-up the message:

     -=Welcome=-

Please read our rules!

once an avatar collides with it - for best results it can serve as a landing pad so new avatars collide with the greeter.

Additionally, the script hands out any items in the inventory except scripts to the agents once and remembers them so it does not send them a second time.

Setup

  • Create a new primitive and place it somewhere under the landing spot so that new avatars collide with it when they teleport to the simulator.
  • Drop the items that you want visitors to get.
  • Create a new script inside the same primitive and copy & paste the script inside it.

Note

The script is design to garbage-collect the avatar list once it runs under 2KB of free memory by removing the first element in the list.

Code

push_greeter.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.        //
///////////////////////////////////////////////////////////////////////////
 
list avs = [];
 
default
{
    state_entry() {
        llVolumeDetect(TRUE);
        llSensorRepeat("", "", AGENT, 5, TWO_PI, 1);
        llSetTimerEvent(1);
    }
 
    sensor(integer num) {
        do {
            key av = llDetectedKey(num);
            if(av == NULL_KEY) jump continue;
            if(llListFindList(avs,(list)av) != -1) jump continue;
            avs += av;
            integer i = llGetInventoryNumber(INVENTORY_ALL);
            list items = [];
            do {
                string name = llGetInventoryName(INVENTORY_ALL, i);
                if(llGetInventoryType(name) == INVENTORY_SCRIPT) jump nextitem;
                items += name;
@nextitem;
            } while(--i >= 0);
            if(llGetListLength(items) == 0) return;
            llGiveInventoryList(av, "Rules and Landmark.", items);
@continue;
        } while(--num != -1);
    }
    collision_start(integer num) {
        do {
            key av = llDetectedKey(num);
            if(av == NULL_KEY) jump continue;
            llDialog(av, "\n     -=Welcome=-\n\n\tPlease read our rules!", [], -1);
@continue;
        } while(--num != -1);
    }
 
    timer() {
        // Less than 2KB left, start trimming the list.
        if(llGetFreeMemory() > 2048) return;
        avs = llDeleteSubList(avs, 0, 0);
    }
    on_rez(integer num) {
        llResetScript();
    }
}

secondlife/push_greeter.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.