Hovering Text Script

Expired

// Hovering Text Script
// Written by and Comments by: Malaer Sunchaser
// Very Simple Script that allows you to hover text over an object.
// How The Script Works:
// llSetText() Specifies for the object to create text above it.  
//
// Customizing the script:
// Change the text inside of "TEXT GOES HERE" to whatever you please.
// The <1 .0,1.0,1.0> is the color the text will show in Float form, 1.0,1.0,1.0
// being WHITE while, 0.0, 0.0, 0.0 is BLACK this is all in RGB (Red, Green, Blue).
// experiement with combinations to get different colors.
// The 1 at the end sets the text's transparency, 1.0 being SOLID, while 0 would be clear,
// and .5 would be half way between clear and solid.

default
{
    state_entry()
    {
        llSetText("
Website link to
Video (fast) from
The Last Meeting", <0.0,1.0,1.0>, 1);
    }
}

 

Visitor Greeter

Expired

/*//( v7-D Advanced Avatar Greeter v1.4.1 Annotated )//*/
/*//    (C)2009 (CC-BY) [ http://creativecommons.org/licenses/by/3.0 ]    //*/
/*//   Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ]  //*/
/*//  All usages must contain a plain text copy of the previous 2 lines.  //*/
/*//--                                                                  --//*/

//Update - Chimera Firecaster (05/10/2010): two very small modifications
//  which allows for personalizing the greeting message by including
//  the visitor's name, and also allows for a multi-line greeting
//  message (see: ADD YOUR MESSAGE HERE)

/*//-- NOTE:
 Remove Any Instances Of "(gLstAvs = []) + " Or "(gLstTms = []) + " When Compiling This
 Script To MONO. They Are Provided For LSO Memory Preservation And Do Nothing In MONO
//*/

list    gLstAvs;        /*//-- List Of Avatars Keys Greeted --//*/
list    vLstChk;        /*//-- List Of Single Av Key Checked During Sensor Processing --//*/
integer vIdxLst;        /*//-- Index Of Checked Item In List (reused) --//*/
integer gIntMax = 500;  /*//-- Maximum Number of Names To Store --//*/
 /*//-- Previous Code Line PreSet to Ease Removing Dynamic Memory Limitation Code --//*/

 /*//-- Next Code Line  Belongs to Dynamic Memory Limitation Section --//*/
integer int_MEM = 1000; /*//-- memory to preserve for safety (Needs to be > ~700)--//*/

 /*//-- Start Av Culling Section --//*/
integer gIntPrd = 172800; /*//-- Number Of Seconds After Detection To Store Av --//*/
integer vIntNow;          /*//-- Integer To Store Current Time During Sensor Processing --//*/
list    gLstTms;          /*//-- List Of Most Recent Times Avs Were Greeted At --//*/
list    vLstTmt;          /*//-- List To Store Timeout During Sensor Processing --//*/
 /*//-- End Av Culling Section --//*/

default{
 state_entry(){
 /*//-- Next Code Line Belongs To Dynamic Memory Limitation Section --//*/
 gIntMax = int_MEM;                   /*//-- Override Max if Dynamic Memory Limitation is in use --//*/
 llSensor( "", "", AGENT, 95.0, PI ); /*//-- Pre-Fire Sensor For Immediate Results --//*/
 llSetTimerEvent( 30.0 );             /*//-- Sensor Repeat Frequency --//*/
 }

 timer(){
 llSensor( "", "", AGENT, 95.0, PI ); /*//-- Look For Avatars --//*/
 }

 sensor( integer vIntTtl ){
 /*//-- Save Current Timer to Now, Then Add Period and Save To Timeout--//*/
 vLstTmt = (list)(gIntPrd + (vIntNow = llGetUnixTime()));
 /*//-- Previous Code Line Belongs to Av Culling Section --//*/
 @Building;{
 /*//-- Is This Av Already In Our List? --//*/
 if (~(vIdxLst = llListFindList( gLstAvs, (vLstChk = (list)llDetectedKey( --vIntTtl )) ))){
 /*//-- Delete The Old Entries & Add New Entries to Preserve Order --//*/
 gLstAvs = llDeleteSubList( (gLstAvs = []) + gLstAvs, vIdxLst, vIdxLst ) + vLstChk;
 /*//-- Next Code Line Belongs to Av Culling Section --//*/
 gLstTms = llDeleteSubList( (gLstTms = []) + gLstTms, vIdxLst, vIdxLst ) + vLstTmt;
 }
 else{
 /*//-- Oo Goody, Hi New Av! Add Them To The Lists & Preserve Max List Size--//*/

// -------
//ADD YOUR MESSAGE HERE
//Delete any "llInstantMessage" lines that you don't need
//If you don't want to include the visitor's name remove this: + llDetectedName( vIntTtl )+"!"
 llInstantMessage( (string)vLstChk, "Greetings " + llDetectedName( vIntTtl )+"!" );
 llInstantMessage( (string)vLstChk, "   Second line of your message - insert your text here" );
 llInstantMessage( (string)vLstChk, "   Third line of your message - insert your text here" );
 llInstantMessage( (string)vLstChk, "   Fourth line of your message - insert your text here");
 llInstantMessage( (string)vLstChk, "   Fifth line of your message - insert your text here" );
 gLstAvs = llList2List( (gLstAvs = []) + vLstChk + gLstAvs, 0, gIntMax );
 /*//-- Next Code Line Belongs to Av Culling Section --//*/
 gLstTms = llList2List( (gLstTms = []) + vLstTmt + gLstTms, 0, gIntMax );
 }
 }if (vIntTtl) jump Building;

 /*//-- Start Dynamic Memory Limitation Section --//*/
 /*//-- Only lower Max List Size Once For Saftey --//*/
 if (int_MEM == gIntMax){
 /*//-- do we have plenty of room in the script? --//*/
 if (int_MEM > llGetFreeMemory()){
 /*//-- running out of room, set the Max list size lower --//*/
 gIntMax = ~([] != gLstAvs);
 }
 }
 /*//-- End Dynamic Memory Limitation Section --//*/

 /*//-- Start Av Culling Section --//*/
 /*//-- do we have keys? --//*/
 if (vIdxLst = llGetListLength( gLstTms )){
 /*//-- Do Any Need Culled? --//*/
 if (vIntNow > llList2Integer( gLstTms, --vIdxLst )){
 /*//-- Find The Last Index that hasn't hit timeout status --//*/
 @TheirBones; if (--vIdxLst) if (vIntNow > llList2Integer( gLstTms, vIdxLst )) jump TheirBones;
 /*//-- Thin the herd --//*/
 gLstAvs = llList2List( (gLstAvs = []) + gLstAvs, 0, vIdxLst );
 gLstTms = llList2List( (gLstTms = []) + gLstTms, 0, vIdxLst );
 }
 }
 /*//-- End Av Culling Section --//*/
 }
}

/*//--                           License Text                           --//*/
/*//  Free to copy, use, modify, distribute, or sell, with attribution.   //*/
/*//    (C)2009 (CC-BY) [ http://creativecommons.org/licenses/by/3.0 ]    //*/
/*//   Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ]  //*/
/*//  All usages must contain a plain text copy of the previous 2 lines.  //*/
/*//--              

 

High Capacity Greeter Counter

Expired

Uses a memory compression algorithm to store hashed visitor UUID's in a string instead of using a list, thus avoiding the extra memory overhead associated with lists as well as reducing the UUID to a 3-character element in that string. See notes in the script and the reference to Becky Pippen's User page for a description of the technique.

 

  • Records unique visitors only.
  • Offers a notecard to unique visitors, if a notecard has been placed in inventory.
  • Provides the current weekly count, if requested by chat command on channel 37.
  • Optionally, provides the owner with a week-end report of the total number of visitors that week.
  • Stores the weekly total each week in the object's Description field, which will survive if the script is reset for any reason or if the object is taken to the owner's inventory.

Update (4/13/2013): Modified by replacing the sensor sweep that was in the original version with llGetAgentList, which is much more sim-friendly.

 

//High-Capacity greeter/counter -- Rolig Loon --  March 2010
//Incorporating a memory compression algorithm by Becky Pippen (https://wiki.secondlife.com/wiki/User:Becky_Pippen/Hashing)
//Please keep all notes intact, including this header.
 
//Revision (4/13/2013): Replaced llSensor with llGetAgentList. As written, this sensor now detects all traffic in the parcel.
 
// Records unique visitors only, not repeaters. Stores the weekly count in the object's Description field and (optionally) sends a report to the owner
 
// Commands on channel 37:   "list" gives the current traffic count since the previous Saturday midnight
//                           "reports" toggles the weekly report to the owner on or off
 
// If there is a notecard in inventory, the counter will offer it on a visitor's first encounter.
 
integer count;
integer restart = TRUE;
integer TellOwner = TRUE;
string hashedNames;
integer hashSize = 3;
 
string getDay()
{
    list weekdays = ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"];
    integer hours = llGetUnixTime()/3600;
    integer days = (hours -4)/24;
    integer day_of_week = days%7;
    return llList2String(weekdays, day_of_week);
}
 
string encode15BitsToChar(integer num)
{
    num = 0x1000 + (num & 0x00007fff);
    return llUnescapeURL(
        escapeHexChar(0xe0 + (num >> 12)) +
        escapeHexChar(0x80 + ((num >> 6) & 0x3f)) +
        escapeHexChar(0x80 + (num & 0x3f)));
}
 
string escapeHexChar(integer n)
{
    string hexChars = "0123456789abcdef";
    return "%" +
        llGetSubString(hexChars, n >> 4, n >> 4) +
        llGetSubString(hexChars, n & 0xf, n & 0xf);
}
 
default
{
    state_entry()
    {
        llSetTimerEvent( 30.0 );
        llListen(37,"","","");
    }
 
    listen(integer channel, string name, key id, string msg)
    {
        if (llToLower(msg) == "list")
        {
            llSay(0, "We have had " + (string)count + " unique visitors since midnight last Saturday.");
        }
        else if (llToLower(msg) == "reports") // Toggles weekly report to owner on /off
        {
            TellOwner = !TellOwner;
        }
    }
 
    timer()
    {
        if (getDay() == "Sunday" && restart == TRUE)
        {
            llSetObjectDesc(llGetObjectDesc() + ","+(string)count);
            if(TellOwner)
            {
                llInstantMessage(llGetOwner(),"The count for the week is " + (string)count);
            }
            count = 0;
            restart = FALSE;
        }
        else if (getDay() == "Monday")
        {
            restart = TRUE;
        }
        list Who = llGetAgentList(AGENT_LIST_PARCEL,[]); //Modify here to detect AGENT_LIST_REGION if desired
        integer i = llGetListLength(Who);
        while(i)
        {
            if ((llStringLength( hashedNames ) * 4.2) > llGetFreeMemory()) // In case memory gets tight
            {
                hashedNames = llGetSubString(hashedNames,3,-1); //Delete the oldest entry in hashedNames
            }
            string AvKey = llList2Key(Who,i);
            string md5 = llMD5String(AvKey, 0);
            integer n1 = (integer)("0x" + llGetSubString(md5, 0, 7));
            integer n2 = (integer)("0x" + llGetSubString(md5, 8, 11));
            string encoded3Chars =
                encode15BitsToChar(n1 >> 16) +
                encode15BitsToChar(n1) +
                encode15BitsToChar(n2);
            integer idx = llSubStringIndex(hashedNames, encoded3Chars);
            if (idx == -1) 
            {
            // this is a new one, so save it and send a notecard, if there is one
                hashedNames += encoded3Chars;
                ++count;
                if(llGetInventoryNumber(INVENTORY_NOTECARD))
                {
                    llGiveInventory(AvKey,llGetInventoryName(INVENTORY_NOTECARD,0));
                }
            }
            --i;
        }
    }
}

 

Visitor Tracker

Expired

// This script will email you a daily count of new visitors and repeat visitors.
// Visitors are counted once per email update cycle.
 
// -----------------------------------
// Configuration: customize this script here.
// Change this to your email address.
string MyEmail = "This email address is being protected from spambots. You need JavaScript enabled to view it.";
// This is a number 0 to 96 meters, anything farther away than that will not be noticed.  
float SensorRange = 96.0;
// How often to send email updates.
integer UpdateFrequency = 86400; // Number of seconds in 1 day.
// -----------------------------------
 
// Internal Variables -- Do not change.
list todayVisitors = [];
list allVisitors = [];
list repeatVisitors = [];
list firstTimers = [];
integer newVisitors = 0;
integer returnVisitors = 0;
string ParcelName;
 
default
{
    state_entry()
    {
        list parcelDetails = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME]);
        ParcelName = llList2String(parcelDetails, 0);
        llSensorRepeat( "", "", AGENT, SensorRange, PI, 20);
        llSetTimerEvent(UpdateFrequency); // Email me a regular report.
        llOwnerSay("Visitor Log Started.");
    }
 
    sensor(integer avsFound)
    {
        key  avKey;
        integer avNum;
        for(avNum=0; avNum500)
        {
            allVisitors = llList2List(allVisitors, 0, 499);
        }
        llEmail(MyEmail, subj, body);
    }
}