Code: Visitor with Multiple Managers

Yet another variation is another version I created for Keaton Oconnell so that the script is based on an access list allowing multiple users in the access list to manipulate the object and deny access to others. For this to work, simply drop the script in the prim you have chosen and also drop a notecard called Access List in the same prim. In the notecard Access List in the prim, supply all the names (usernames) allowed to manipulate the object line by line. For example, if one would wish Keaton Oconnell to have sole access to the visitor prim, then the notecard should contain only one line: Keaton Oconnell. If one would wish to allow Wizardry and Steamworks and Keaton Oconnell, then the notecard would contain:

Morgan LeFay
Keaton Oconnell

Code

This script was tested and works on OpenSim version 0.7.4!

visitor_multiplemanagers.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 vList = [];
list aList = [];
key aQuery = NULL_KEY;
integer comHandle = 0;
integer comChannel = 0;
integer scanInterval = 2;
integer scanRange = 10;
 
default {
 
    state_entry() {
        aQuery = llGetNotecardLine("Access List", comHandle);
        llSensorRepeat("", "", AGENT, scanRange, TWO_PI, scanInterval);
    }
 
    changed(integer change) {
        if (change & CHANGED_INVENTORY) {
            aList = [];
            comHandle = 0;
            aQuery = llGetNotecardLine("Access List", comHandle);
        }
    }
 
    touch_start(integer total_number) {
        if (llListFindList(aList, (list) llDetectedName(0)) == -1) return;
        comChannel = ((((integer)("0x" + llGetSubString(((string) llGetKey()), -8, -1))) & 1073741823) ^ -1073741825);
        comHandle = llListen(comChannel, "", llDetectedKey(0), "");
        llDialog(llDetectedKey(0), "\n[K] Visitor list: Please select an option. \n", ["Reset", "View", "Range", "Interval"], comChannel);
    }
 
    listen(integer chan, string name, key id, string mes) {
        if (mes == "Interval") {
            llDialog(id, "\n[K] Visitor list: Please select a scanning interval in seconds.\n", ["2s", "4s", "8s", "16s", "32s", "64s"], comChannel);
            return;
        }
        if (mes == "Range") {
            llDialog(id, "\n[K] Visitor: Please select a scanning distance in meters.\n", ["5", "10", "15", "30", "35", "40", "45", "50", "60", "70", "80", "90"], comChannel);
            return;
        }
        if (mes == "Reset") {
            vList = [];
            jump zout;
        }
        if (mes == "View") {
            integer aPtr = llGetListLength(vList) - 1;
            llInstantMessage(id, "----------------------- Visitors -------------------------");
            do {
                llInstantMessage(id, ((llList2String(vList, aPtr) + " @ ") + llList2String(vList, (aPtr - 1))));
                aPtr -= 2;
            } while (aPtr > -1);
            llInstantMessage(id, "------------------------------------------------------------");
            jump zout;
        }
        integer iMes = (integer) mes;
        if (iMes == 0) jump zout;
        if (iMes && !(iMes & (iMes - 1))) {
            scanInterval = iMes;
            llSensorRepeat("", "", AGENT, scanRange, TWO_PI, scanInterval);
            jump zout;
        }
        if (iMes % 5 == 0) {
            scanRange = iMes;
            llSensorRepeat("", "", AGENT, scanRange, TWO_PI, scanInterval);
            jump zout;
        }
@zout;
        llListenRemove(comHandle);
    }
 
    sensor(integer num) {
        --num;
        do {
            if (llListFindList(vList, (list) llDetectedName(num)) != -1) jump continue;
            if (llGetFreeMemory() < 2048 && llGetListLength(vList) != 0) vList = llDeleteSubList(vList, 0, 0);
            vList += [ llGetTimestamp() ] + [ llDetectedName(num) ];
@continue;
        } while (--num > -1);
    }
 
    dataserver(key query_id, string data) {
        if (query_id != aQuery) return;
        if (data == EOF) return;
        aList += (list) data;
        aQuery = llGetNotecardLine("Access List", (++comHandle));
    }
}

secondlife/visitors/multiple_managers/simple.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.