Viewer URIs
The Second Life viewer recognises its own kind of link: text that starts with secondlife://. When a script writes one into local chat or a dialog, the viewer highlights it as a clickable link, often with custom formatting including icons. A click can open a profile, show a group, offer a teleport, put a place on the world map, or replace the link with an avatar’s name. These links are handled by the viewer, not the simulator, so a script only has to build the right string.
This is not a scripting API. There are no functions for it. It is a set of text conventions that combine with ordinary chat and dialog functions, plus the keys and names a script already has.
Viewer URIs are an lsl.dev addition. They are not one of slua.dev’s features.
Concepts
- There are two forms. A region location,
secondlife://<region_name>/<local_x>/<local_y>/<local_z>, logs in to that region or, if logged in, shows information and offers a teleport. An application URI,secondlife:///app/…, with three slashes, controls the user interface directly- The full list of forms, with their parameters, is in the URI reference
- Most
secondlife:///appURLs only work from browser instances running inside Second Life, because of a denial-of-service attack that used teleport links to force repeated teleports
- In chat, dialogs and other user interface elements, these URLs are highlighted as clickable links. A script can put one in front of people by
- speaking in local chat, telling only its owner or speaking privately to one avatar
- writing it into the message of a dialog with buttons, where some application URLs also receive special formatting
- writing it into the prompt of a text box, which is also a dialog
- sending an instant message. Older viewers showed clickable links, without formatting, in IM history
- Agent links work from an avatar’s key
- They can show the avatar’s display name, their username, or both, in place of the link. Each viewer fills in the name, so the script needs no display name request and no
dataserverevent - Others open the profile, the inspect dialog, an IM session, the pay dialog, a friendship or teleport offer, or block and unblock the avatar
- The key usually comes from whoever touched or was detected, or from the object’s owner
- They can show the avatar’s display name, their username, or both, in place of the link. Each viewer fills in the name, so the script needs no display name request and no
- Group links open a group’s profile or inspect dialog; a script can read its object’s group to build one
- Place links name a region and a position inside it, as map links or teleport links
- Scripts get the region’s name and the object’s position to fill them in. Positions default to 128, 128 and 0 when left out
- Object links display an info dialog for an object, from its
key, with optional name, owner, group ownership and location parameters. Values in the query needescaping - Other links open the inventory, search, help, floaters and keybindings, or add, remove and wear outfit folders
Functions used with viewer URIs
The functions that show these links to people, and the ones that supply the keys, names and positions they are built from.
void | llSay(integer channel, string msg) |
void | llOwnerSay(string msg) |
void | llRegionSayTo(key target, integer channel, string msg) |
void | llInstantMessage(key agent, string msg) |
void | llDialog(key agent, string msg, list buttons, integer channel) |
void | llTextBox(key agent, string msg, integer channel) |
key | llDetectedKey(integer number) |
key | llGetKey() |
list | llGetObjectDetails(key id, list params) |
string | llGetRegionName() |
string | llEscapeURL(string url) |
URI reference
Every secondlife:// and secondlife:///app/ form from the wiki’s Viewer URI Name Space page, with its parameters, login query parameters and the keybinding actions.
Names without a dataserver request
llGetDisplayName only works for avatars in the region or in the cache, and llRequestDisplayName answers through dataserver. To only show a name, the /displayname, /username and /completename agent links are simpler.
Scripting Details
Here are the functions in detail.
void | llSay(integer channel, string msg)Broadcasts the message msg to all scripts or agents listening on channel within llGetEnv("chat_range"), which is 20m on most regions. Agents listen on PUBLIC_CHANNEL (0) and DEBUG_CHANNEL (2147483647). All other channels are for script-to-script communication. |
void | llOwnerSay(string msg)Sends the chat message msg privately to the object owner (the owner must be currently in the same region for the message to be received). |
void | llRegionSayTo(key target, integer channel, string msg)Sends the message msg on Channel privately to the targeted agent or object (if within the region). If target is an agent and channel is non-zero, the message can also be heard by any attachments worn by the avatar. |
void | llInstantMessage(key agent, string msg)Sends an instant message containing msg to the agent identified by their key. |
void | llDialog(key agent, string msg, list buttons, integer channel)Shows a dialog box on the screen of the specified agent, displaying msg along with up to 12 choice buttons. Clicking a button chats its label on channel. The chat originates at the object's position, but uses the agent's name and UUID, so it can be heard as long as the agent is still in the region. |
void | llTextBox(key agent, string msg, integer channel)Opens an input text box dialog displaying msg to the agent. Submitting text chats the input string on channel as if said by the agent. The chat originates at the object's position, but uses the agent's name and UUID, so it can be heard as long as the agent is still in the region. |
key | llDetectedKey(integer number)Returns the key (UUID) of the detected object or avatar specified by number, or NULL_KEY if number is not a valid index. |
key | llGetKey()Returns the key (UUID) of the prim containing the script. |
list | llGetObjectDetails(key id, list params)Returns a list containing the requested parameters of the specified avatar or object id, retrieved in the order requested by params. |
string | llGetRegionName()Returns a string containing the name of the current region. |
string | llEscapeURL(string url)Returns a string representing the escaped/encoded version of url, replacing spaces with '%20' and non-alphanumeric characters with their '%xx' hexadecimal UTF-8 equivalent. |
Additional
llSay,llOwnerSayandllRegionSayTo— the usual ways to put a link in an avatar’s chatPUBLIC_CHANNEL— The open local chat channel (0)
llDetectedKey— The wiki’s own example:"secondlife:///app/agent/" + (string)llDetectedKey(0) + "/inspect"in atouch_starteventllGetObjectDetails— Keys for object and group linksOBJECT_GROUP— The object’s group key, forsecondlife:///app/group/<group_id>/aboutOBJECT_OWNER— The owner’s key, for an agent link or the&owner=parameter of an object link
secondlife:///app/chat/<channel>/<text>— any channel number greater than 0 exceptDEBUG_CHANNEL
Example
Section titled “Example”The example from the wiki page: whoever touches the object is named in chat with a link to their inspect dialog.
string Who(key id){ return "secondlife:///app/agent/" + (string)id + "/inspect";}
default{ touch_start(integer num) { llSay(0, "Touched by " + Who(llDetectedKey(0)) + "." ); }}Related
Section titled “Related”- Second Life wiki: Viewer URI Name Space, SLURL
See also Feature CommunicationsFeature DialogFeature AvatarsFeature Parcels & RegionsCategory ChatPlanned Recipe: a greeter that names visitors with agent linksPlanned Recipe: a landmark giver that posts teleport links
Concepts and the example are adapted from the Second Life Wiki page Viewer URI Name Space (revision 1219168, 2026-10-06); history, by Second Life Wiki contributors, under CC BY-SA 3.0. Last wiki edit: .