Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Avatare im Besucherboard ausklammern
#4
Schau im nachfolgenden Skript nach myIgnoreList.

PHP-Code:
// Artemis Tesla 2010-12-12
// Script for showing visitors log on a board
// Put script on a prim and reset
// Requires osGetAgents to be enabled in Opensim\bin\config-include\osslEnable.ini :
// Allow_osGetAgents = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
// or put line in opensim.ini [xengine] section if not using osslEnable.ini file
// Jeff Hall - September 2017
// Manni 2020

// Color Name:
//     "AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque",
//     "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood",
//     "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk",
//     "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGrey",
//     "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOrange",
//     "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue",
//     "DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue",
//     "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen", "Fuchsia",
//     "Gainsboro", "GhostWhite", "Gold", "Goldenrod", "Grey", "Green", "GreenYellow",
//     "Honeydew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender",
//     "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral",
//     "LightCyan", "LightGoldenrodYellow", "LightGreen", "LightGrey", "LightPink",
//     "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGrey",
//     "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta",
//     "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumPurple",
//     "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise",
//     "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin",
//     "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed",
//     "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "PaleVioletRed",
//     "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple",
//     "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown",
//     "SeaGreen", "Seashell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGrey",
//     "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato",
//     "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"


list gDetected = [];
list 
gVisitors = [];
list 
myIgnoreList = [];
list 
myCleanedList = [];

string gTime "";

// User Setup - Font - Text - Color - Time
integer Pixel_width 512;
integer Pixel_height 512;
string FontName "Arial";
integer TextSize 9;
string TextBaseColor "White";
string TimeBaseColor "White";
string NameBaseColor "White";
string NameBackroundColor "Black";
integer refreshtimeevent 10;

// Colorbox
string Colorbox1 "Black"integer Colorboxwidth1 100integer Colorboxheight1 512;
string Colorbox2 "DarkGrey"integer Colorboxwidth2 100integer Colorboxheight2 512;
string Colorbox3 "LightGrey"integer Colorboxwidth3 100integer Colorboxheight3 512;
string Colorbox4 "Grey"integer Colorboxwidth4 120integer Colorboxheight4 512;

// Setup End

list ListXnotY(list lx, list ly)
{
    
// return elements in X list that are not in Y list
    
list lz;
    
integer i llGetListLength(lx);
    while(
i--)
    if ( !~
llListFindList(ly,llList2List(lx,i,i)) ) // * see Note
            
lz += llList2List(lx,i,i);
    return 
lz;
}

display()
{
    
string draw "";
    
string body "width:" Pixel_width ",height:" Pixel_height ",bgcolour:" NameBackroundColor;

    
// horizontal
    
draw osSetPenColordraw"Black" );           // Set the pen color to red
    
draw osMovePendraw0);               // Upper left corner at <28,78>
    
draw osDrawFilledRectangledraw51028 ); // 200 pixels by 100 pixels
    // erste flaeche
    
draw osSetPenColordraw"DarkGrey" );           // Set the pen color to red
    
draw osMovePendraw028 );               // Upper left corner at <28,78>
    
draw osDrawFilledRectangledraw90479 ); // 200 pixels by 100 pixels
    // zweite flaeche
    
draw osMovePendraw8528 );
    
draw osSetPenColordraw"LightGrey" );           // Set the pen color to blue
    
draw osDrawFilledRectangledraw100479 ); // 200 pixels by 100 pixels
    // dritte flaeche
    
draw osMovePendraw18028 );
    
draw osSetPenColordraw"Grey" );           // Set the pen color to blue
    
draw osDrawFilledRectangledraw330479 ); // 200 pixels by 100 pixels
    // vierte flaeche
    //draw = osMovePen( draw, 295, 28 );
    //draw = osSetPenColor( draw, "Maroon" );           // Set the pen color to blue
    //draw = osDrawFilledRectangle( draw, 220, 479 ); // 200 pixels by 100 pixels

    // ende grafiken

    
osSetDynamicTextureData"""vector"drawbody0);
    
string log =  osGetGridName() + " Visitors";

    
integer visitors llGetListLength(gVisitors) / 3;

    while(
visitors--)
    {
        
log log "\n" llList2String(gVisitorsvisitors 2) + " - " +
                           
llList2String(gVisitorsvisitors 1) + " - " +
                           
llList2String(gVisitorsvisitors 3);
    }

    
draw osSetFontSize(drawTextSize);
    
draw osSetFontName(drawFontName);
    
draw osSetPenSize(draw);
    
draw osMovePen(draw1013);
    
draw osSetPenColor(drawTextBaseColor);
    
draw osDrawText(drawlog);

   
//osSetDynamicTextureDataBlendFace("", "vector", draw, body, FALSE, 2, 0, 255, 4); // Single Side
   
osSetDynamicTextureData"""vector"drawbody); // all side
}


string time()
//0123 4 56 7 89 0 12 3 45
    //YYYY - MM - DD T hh : mm:ss.ff..fZ
    
string now llGetTimestamp();
    return 
llGetSubString(now,0,9) + " " +
           
llGetSubString(now,11,15);
}


string duration(string timeInstring timeOut)
{
    
integer came = ((integer)llGetSubString(timeIn,11,12) * 60) + (integer)llGetSubString(timeIn,14,15);
    
integer went = ((integer)llGetSubString(timeOut,11,12) * 60) + (integer)llGetSubString(timeOut,14,15);

    if (
came == went) if(llGetSubString(timeIn,8,9) != llGetSubString(timeOut,8,9)) went went 1440;

    if (
came wentwent went 1440;
    
went went came;

    return 
llGetSubString("00" + (string)((went - (went 60)) / 60), -2, -1) + ":" +
           
llGetSubString("00" + (string)(went 60), -2, -1);
}


detectVisitorInOut(list avatars)
{
    
integer avatar llGetListLength(avatars);
    
string name "";

    while(
avatar--)
    {
        
name llList2String(avatarsavatar);
        if (
llSubStringIndex((string)gDetectedname) == -1gVisitors gVisitors + [name"00:00"gTime];

        
//if (llGetListLength(gVisitors) >= 63) gVisitors = llDeleteSubList(gVisitors, 0, 2);
        
if (llGetListLength(gVisitors) >= 126gVisitors llDeleteSubList(gVisitors02);
    }

    
avatar llGetListLength(gDetected);
    
name "";

    while(
avatar--)
    {
        
name llList2String(gDetectedavatar);
        if (
llSubStringIndex((string)avatarsname) == -1)
        {
            
integer position llListFindList(gVisitors, [name"00:00"]) + 1;
            
string time duration(llList2String(gVisitorsposition 1), gTime);
            
gVisitors llListReplaceList(gVisitors, [time], positionposition);
        }
    }
}


visitorOut()
{
    
integer avatar llGetListLength(gDetected);
    
string name "";

    while(
avatar--)
    {
        
name llList2String(gDetectedavatar);
        
integer position llListFindList(gVisitors, [name"00:00"]) + 1;
        
string time duration(llList2String(gVisitorsposition 1), gTime);
        
gVisitors llListReplaceList(gVisitors, [time], positionposition);
    }
}


default
{
    
state_entry() { llSetTimerEvent(refreshtimeevent); }

    
timer()
    {

       list 
avatarList osGetAgents();

       list 
myIgnoreList = ["first npc","second npc"];

       list 
myCleanedList ListXnotY(avatarListmyIgnoreList);

        if ((string)
myCleanedList != (string)gDetected)
        {
            
gTime time();

            if (
myCleanedList != []) detectVisitorInOut(myCleanedList);
            else 
visitorOut();

            
gDetected myCleanedList ;
            
display();
        }
    }

Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



[-] The following 1 user says Thank You to Manfred Aabye for this post:
  • Xenos Yifu
Zitieren


Nachrichten in diesem Thema
RE: Avatare im Besucherboard ausklammern - von Manfred Aabye - 15.03.2022, 15:59

Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  OpenSim Besucherboard Kubwa 3 3.210 13.01.2021, 09:10
Letzter Beitrag: Xenos Yifu

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste