Skip to content
lsl.devlsl.devLSL Dev

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:///app URLs 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
  • Agent links work from an avatar’s key
  • 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
  • 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 need escaping
  • 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.

voidllSay(integer channel, string msg)
voidllOwnerSay(string msg)
voidllRegionSayTo(key target, integer channel, string msg)
voidllInstantMessage(key agent, string msg)
voidllDialog(key agent, string msg, list buttons, integer channel)
voidllTextBox(key agent, string msg, integer channel)
keyllDetectedKey(integer number)
keyllGetKey()
listllGetObjectDetails(key id, list params)
stringllGetRegionName()
stringllEscapeURL(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.

voidllSay(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.
voidllOwnerSay(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).
voidllRegionSayTo(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.
voidllInstantMessage(key agent, string msg)
Sends an instant message containing msg to the agent identified by their key.
voidllDialog(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.
voidllTextBox(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.
keyllDetectedKey(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.
keyllGetKey()
Returns the key (UUID) of the prim containing the script.
listllGetObjectDetails(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.
stringllGetRegionName()
Returns a string containing the name of the current region.
stringllEscapeURL(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

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)) + "." );
}
}

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: .