Visitor with Display Names

By indications from Foxxe Wilder, it seems to be the case that one would want to link display names to usernames in a visitor script such as this. Foxxe Wilder is an estate manager and sometimes renters report other players by their display names and there is no way to link the username to the display name in case they have to be chased up.

The following script is another version which also logs display names based on that concept.

Code

This script was tested and works on OpenSim version 0.7.4!

visitor_displaynames.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 = [];
integer comHandle = 0;
integer comChannel = 0;
integer scanInterval = 2;
integer scanRange = 10;
 
default {
 
    state_entry() {
        llSensorRepeat("", "", AGENT, scanRange, TWO_PI, scanInterval);
    }
 
    touch_start(integer total_number) {
        if (llDetectedKey(0) != llGetOwner()) return;
        comChannel = ((((integer)("0x" + llGetSubString(((string) llGetKey()), -8, -1))) & 1073741823) ^ -1073741825);
        comHandle = llListen(comChannel, "", llGetOwner(), "");
        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(llGetOwner(), "\n[K] Visitor list: Please select a scanning interval in seconds.\n", ["2s", "4s", "8s", "16s", "32s", "64s"], comChannel);
            return;
        }
        if (mes == "Range") {
            llDialog(llGetOwner(), "\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) + " @ " + llList2String(vList, aPtr - 2));
                aPtr -= 3;
            } 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) ] + [ llGetDisplayName(llDetectedKey(num)) ];
@continue;
        } while (--num > -1);
    }
}

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