Difference between revisions of "User:Daemonika Nightfire/Scripts/DS Display-Username Online Indicator"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
m (Replaced <source> with <syntaxhighlight>, corrected some formatting, did some spell-checking on the English translation (and added Umlauts for the German text!))
 
Line 2: Line 2:
by Daemonika Nightfire (daemonika.nightfire)
by Daemonika Nightfire (daemonika.nightfire)
   
   
This simple hover text-based script is used to shop owners in Second Life,
This simple hovertext-based script can be used by shop owners in Second Life
customers at the current display name and user name to display publicly.
to publicly display their current [[Display names|Display Name]] and [[Usernames|username]].
Additionally shows the status of the Userkey and online.
Furthermore, there are click of a chat link that opens the profile owner.


This gives your customers more security, buy at the right vendor
It additionally shows the avatar's [[UUID#Account_UUIDs|user key]] and online status.
 
Furthermore, on [[Touch start|clicking]] the object with this script, it will show an URL that opens the owner's [[profile]].
 
This gives your customers more security that they're buying from the right vendor.


This script can be freely used and altered.
This script can be freely used and altered.
It is not worthwhile to sell it, because I distribute FREE!
 
It is not worthwhile to sell it, because I distribute it for FREE!


==*DS* Display-Username Online Indicator v2.1==
==*DS* Display-Username Online Indicator v2.1==
Script Time!
Script Time!
The Script has a script time around ~0.003 ms.
The Script has a script time around ~0.003 ms.
<source lang="lsl2">
<syntaxhighlight lang="lsl2">
/*
/*
   
     *DS* Display-/Username Online Indicator
     *DS* Display-/Username Online Indicator
     by Daemonika Nightfire (daemonika.nightfire)
     by Daemonika Nightfire (daemonika.nightfire)
      
      
     Dieses einfache Hovertext Basierende Script dient dazu Shopbetreibern in Second Life,
     Dieses einfache Hovertext Basierende Script dient dazu Shopbetreibern in Second Life,
     ihren Kunden den aktuellen Displayname & Username oeffentlich anzuzeigen.
     ihren Kunden den aktuellen Displayname & Username öffentlich anzuzeigen.
     Zusaetzlich zeigt des den Userkey und Online Status an.
     Zusätzlich zeigt des den Userkey und Online Status an.
     Weiterhin gibt es bei click einen Chatlink aus, der das BesitzerProfil oeffnet.
     Weiterhin gibt es bei click einen Chatlink aus, der das BesitzerProfil öffnet.
      
      
     Dieses Script darf frei verwendet und veraendert werden.
     Dieses Script darf frei verwendet und verändert werden.
     Es lohnt sich nicht es zu verkaufen, denn ich verteils FREE!
     Es lohnt sich nicht es zu verkaufen, denn ich verteils FREE!
      
      
     LG
     LG
     Dae
     Dae
*/
*/


Line 48: Line 49:
         User_key = llGetOwner();
         User_key = llGetOwner();
         Display_name_query = llRequestDisplayName(User_key);
         Display_name_query = llRequestDisplayName(User_key);
         llSetTimerEvent(120); // 60 - 120 sec. empfohlen
         llSetTimerEvent(120); // 60 - 120 sec. empfohlen|recommended
     }
     }


Line 58: Line 59:
     dataserver(key queryid, string data)
     dataserver(key queryid, string data)
     {
     {
         if(Display_name_query == queryid)
         if (Display_name_query == queryid)
         {
         {
             User_displayname = data;
             User_displayname = data;
             User_name_query = llRequestUsername(User_key);
             User_name_query = llRequestUsername(User_key);
         }
         }
         if(User_name_query == queryid)
         if (User_name_query == queryid)
         {
         {
             User_name = data;
             User_name = data;
Line 69: Line 70:
             output = TRUE;
             output = TRUE;
         }
         }
         if(Online_status == queryid && output)  
         if (Online_status == queryid && output)  
         {
         {
             string Text = "\nDisplayName: "  + User_displayname +
             string Text = "\nDisplayName: "  + User_displayname +
Line 75: Line 76:
                           "\nUserKey: "      + (string)User_key;
                           "\nUserKey: "      + (string)User_key;
                            
                            
             if(data == "1")  
             if (data == "1")  
             {
             {
                 llSetText(Text + "\nONLINE", <0,1,0>, 1);
                 llSetText(Text + "\nONLINE", <0,1,0>, 1);
Line 97: Line 98:
     }
     }
}
}
</source>
</syntaxhighlight>


==*DS* Display-/User-/Resident-Name v2.1==
==*DS* Display-/User-/Resident-Name v2.1==
you see with this by touch all your names.
When touched, the object with this script will show all your names (Display Name, username, avatar key, etc.).
<source lang="lsl2">
<syntaxhighlight lang="lsl2">
key User_key;
key User_key;
key User_name_query;
key User_name_query;
Line 108: Line 109:
string User_displayname;
string User_displayname;
integer output = FALSE;
integer output = FALSE;
default
default
{
{
Line 123: Line 125:
     dataserver(key queryid, string data)
     dataserver(key queryid, string data)
     {
     {
         if(Display_name_query == queryid)
         if (Display_name_query == queryid)
         {
         {
             User_displayname = data;
             User_displayname = data;
             User_name_query = llRequestUsername(User_key);
             User_name_query = llRequestUsername(User_key);
         }
         }
         if(User_name_query == queryid)
         if (User_name_query == queryid)
         {
         {
             User_name = data;
             User_name = data;
Line 152: Line 154:
     }
     }
}
}
</source>
</syntaxhighlight>

Latest revision as of 11:18, 7 April 2022

*DS* Display-/Username Online Indicator

by Daemonika Nightfire (daemonika.nightfire)

This simple hovertext-based script can be used by shop owners in Second Life to publicly display their current Display Name and username.

It additionally shows the avatar's user key and online status.

Furthermore, on clicking the object with this script, it will show an URL that opens the owner's profile.

This gives your customers more security that they're buying from the right vendor.

This script can be freely used and altered.

It is not worthwhile to sell it, because I distribute it for FREE!

*DS* Display-Username Online Indicator v2.1

Script Time! The Script has a script time around ~0.003 ms.

/*
    *DS* Display-/Username Online Indicator
    by Daemonika Nightfire (daemonika.nightfire)
    
    Dieses einfache Hovertext Basierende Script dient dazu Shopbetreibern in Second Life,
    ihren Kunden den aktuellen Displayname & Username öffentlich anzuzeigen.
    Zusätzlich zeigt des den Userkey und Online Status an.
    Weiterhin gibt es bei click einen Chatlink aus, der das BesitzerProfil öffnet.
    
    Dieses Script darf frei verwendet und verändert werden.
    Es lohnt sich nicht es zu verkaufen, denn ich verteils FREE!
    
    LG
    Dae
*/

key User_key;
key Online_status;
key User_name_query;
key Display_name_query;
string User_name;
string User_displayname;
integer output = FALSE;

default
{
    state_entry()
    {
        User_key = llGetOwner();
        Display_name_query = llRequestDisplayName(User_key);
        llSetTimerEvent(120); // 60 - 120 sec. empfohlen|recommended
    }

    timer()
    {
        Display_name_query = llRequestDisplayName(User_key);
    }

    dataserver(key queryid, string data)
    {
        if (Display_name_query == queryid)
        {
            User_displayname = data;
            User_name_query = llRequestUsername(User_key);
        }
        if (User_name_query == queryid)
        {
            User_name = data;
            Online_status = llRequestAgentData(User_key, DATA_ONLINE);
            output = TRUE;
        }
        if (Online_status == queryid && output) 
        {
            string Text = "\nDisplayName: "  + User_displayname +
                          "\nUserName: "     + User_name +
                          "\nUserKey: "      + (string)User_key;
                          
            if (data == "1") 
            {
                llSetText(Text + "\nONLINE", <0,1,0>, 1);
            }
            else
            {
                llSetText(Text + "\nOFFLINE", <1,0,0>, 1);
            }
            output = FALSE;
        }
    }

    touch_start(integer num_detected)
    {
        llInstantMessage(llDetectedKey(0),"secondlife:///app/agent/" + (string)User_key + "/about");
    }

    on_rez(integer Dae)
    {
        llResetScript();
    }
}

*DS* Display-/User-/Resident-Name v2.1

When touched, the object with this script will show all your names (Display Name, username, avatar key, etc.).

key User_key;
key User_name_query;
key Display_name_query;
string User_name;
string User_displayname;
integer output = FALSE;

default
{
    state_entry()
    {
        llSetText("touch me", <0.8,0.6,0.2>, 1);
    }

    touch_start(integer num)
    {
        User_key = llDetectedKey(0);
        Display_name_query = llRequestDisplayName(User_key);
    }

    dataserver(key queryid, string data)
    {
        if (Display_name_query == queryid)
        {
            User_displayname = data;
            User_name_query = llRequestUsername(User_key);
        }
        if (User_name_query == queryid)
        {
            User_name = data;
            output = TRUE;
        }
        if(output)
        {
            string Text = "\nDisplayName: "  + User_displayname +
                          "\nUserName: "     + User_name +
                          "\nResidentName: " + (string)llKey2Name(User_key) +
                          "\nUserKey: "      + (string)User_key;
                    
            llSetText("touch me" + Text, <0.8,0.6,0.2>, 1);
            llSay(0,Text);
            
            output = FALSE;
        }
    }

    on_rez(integer Dae)
    {
        llResetScript();
    }
}