<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlDialog</id>
	<title>LlDialog - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlDialog"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlDialog&amp;action=history"/>
	<updated>2026-10-25T11:12:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://wiki.osgrid.org/index.php?title=LlDialog&amp;diff=102&amp;oldid=prev</id>
		<title>Osgridadmin: Created page with &quot;==Function: llDialog( key avatar, string message, list buttons, integer chat_channel );== Shows a blue dialog box in the upper right corner of the avatar&#039;s screen with a messa...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlDialog&amp;diff=102&amp;oldid=prev"/>
		<updated>2017-12-30T18:02:11Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Function: llDialog( key avatar, string message, list buttons, integer chat_channel );== Shows a blue dialog box in the upper right corner of the avatar&amp;#039;s screen with a messa...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Function: llDialog( key avatar, string message, list buttons, integer chat_channel );==&lt;br /&gt;
Shows a blue dialog box in the upper right corner of the avatar&amp;#039;s screen with a message and choice buttons, as well as an ignore button. This has many uses ranging from simple message delivery to complex menu systems. &amp;lt;br&amp;gt;&lt;br /&gt;
• key 	avatar 	– 	avatar UUID that is in the same region 	 &amp;lt;br&amp;gt;&lt;br /&gt;
• string 	message 	– 	message to be displayed  &amp;lt;br&amp;gt;	&lt;br /&gt;
• list 	buttons 	– 	button labels 	 &amp;lt;br&amp;gt;&lt;br /&gt;
• integer 	chat_channel 	– 	output channel, any integer value 	 &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
When a button is pressed, the avatar says the text of the button label on chat_channel. &amp;lt;br&amp;gt;&lt;br /&gt;
The position where the chat is generated is where the dialog generating prim was when the dialog button was pressed. &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;.5&amp;quot; style=&amp;quot;text-align:left&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Channel Constant  !! align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Description&lt;br /&gt;
|-&lt;br /&gt;
| [[DEBUG_CHANNEL]] || 0x7FFFFFFF || Chat channel reserved for debug and error messages from scripts.&lt;br /&gt;
|-&lt;br /&gt;
| [[PUBLIC_CHANNEL]] || 0x0 || Chat channel that broadcasts to all nearby users. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;.5&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;black&amp;quot; | &amp;lt;span style=&amp;quot;color:#CC6633&amp;quot;&amp;gt;Button Order&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 9 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; |10 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot;| 11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 6 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 7 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 8 &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 3 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 4 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 5&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 1 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 2 || style=&amp;quot;margin: 1em auto 1em auto&amp;quot; width=&amp;quot;33%&amp;quot; align=&amp;quot;center&amp;quot; | 3 &lt;br /&gt;
|}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Caveats&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
• This function causes the script to sleep for 1.0 seconds. &amp;lt;br&amp;gt;&lt;br /&gt;
• There is no way by script to kill a dialog box. &amp;lt;br&amp;gt;&lt;br /&gt;
• There is no way for the script to detect if the user clicked the small &amp;quot;ignore&amp;quot; button (no chat is generated as a result of pressing this button). &amp;lt;br&amp;gt;&lt;br /&gt;
• There is no way to distinguish the input from a dialog box and regular chat made by the same user. &amp;lt;br&amp;gt;&lt;br /&gt;
-• It is important to expect that the response may not be one of the buttons.  &amp;lt;br&amp;gt;&lt;br /&gt;
• If the distance between the root prim of the listening object and the dialog generating prim is greater than 20 meters when a button is pressed, the response will not be heard. &amp;lt;br&amp;gt;&lt;br /&gt;
-• This limitation affects attachments too if the wearer moves more than 20 meters from where the listener is located.  &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;message limits&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
• message must be fewer than 512 bytes in length and be not empty. If it is empty, [[llDialog]] will shout &amp;quot;[[llDialog]]: must supply a message&amp;quot; on the [[DEBUG_CHANNEL]]. If it is greater than or equal to 512 bytes, it shouts (again on the debug channel): &amp;quot;[[llDialog]]: message too long, must be less than 512 characters&amp;quot;; in both instances, the dialog box will not be created for avatar. &amp;lt;br&amp;gt;&lt;br /&gt;
• The client only displays 8 lines of message if it is longer the dialog has a scroll bar. See #Appearance.  &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;buttons limits&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
• If buttons is an empty list, it will default to as if it were [&amp;quot;OK&amp;quot;] &amp;lt;br&amp;gt;&lt;br /&gt;
• An error will be shouted on [[DEBUG_CHANNEL]], if... &amp;lt;br&amp;gt;&lt;br /&gt;
-• there are more than 12 buttons. &amp;lt;br&amp;gt;&lt;br /&gt;
-• any list item is not a string. &amp;lt;br&amp;gt;&lt;br /&gt;
-• any list item string length (in bytes) is zero or greater than 24.  &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
integer channel = 1000;&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llListen(channel,&amp;quot;&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start(integer count)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog(llDetectedKey(0), &amp;quot;This is a test dialog.\n\nPlease choose one of the below options.&amp;quot;,&lt;br /&gt;
                 [&amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;0&amp;quot;, &amp;quot;1&amp;quot;], channel);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    listen(integer chan, string name, key id, string mes)&lt;br /&gt;
    {&lt;br /&gt;
        if(id == llGetOwnerKey(id))//won&amp;#039;t listen to objects unless they aren&amp;#039;t in the region.&lt;br /&gt;
            llSay(0,name + &amp;quot; (&amp;quot; + (string)llGetObjectDetails(id, (list)OBJECT_POS) + &amp;quot;) chose option &amp;quot; + mes);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Useful Snippets&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//Compact function to put buttons in &amp;quot;correct&amp;quot; human-readable order&lt;br /&gt;
integer channel;&lt;br /&gt;
 &lt;br /&gt;
list order_buttons(list buttons)&lt;br /&gt;
{&lt;br /&gt;
    return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)&lt;br /&gt;
         + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {   // Create random channel within range [-1000000000,-2000000000]&lt;br /&gt;
	channel = (integer)(llFrand(-1000000000.0) - 1000000000.0);&lt;br /&gt;
 &lt;br /&gt;
	llListen(channel,&amp;quot;&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        llDialog(llDetectedKey(0),&amp;quot;\nPlease choose an option:\n&amp;quot;,&lt;br /&gt;
	    order_buttons([&amp;quot;1&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot;, &amp;quot;5&amp;quot;, &amp;quot;6&amp;quot;, &amp;quot;7&amp;quot;, &amp;quot;8&amp;quot;, &amp;quot;9&amp;quot;, &amp;quot;10&amp;quot;]),channel);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    listen(integer _chan, string _name, key _id, string _option)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, _name + &amp;quot; chose option &amp;quot; + _option);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Notes&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
To use dialog boxes to make menu systems, see Dialog Menus: A step by step guide (aimed at learners). &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tips&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
It is a good idea to use a very negative channel (if never more negative than the most negative 32-bit integer that is -2,147,483,648), e.g., &amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Create random channel within range [-1000000000,-2000000000]&lt;br /&gt;
integer channel = (integer)(llFrand(-1000000000.0) - 1000000000.0);&lt;br /&gt;
 &lt;br /&gt;
llDialog(llDetectedKey(0), &amp;quot;Please choose one of the below options:&amp;quot;,&lt;br /&gt;
    [&amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;0&amp;quot;, &amp;quot;1&amp;quot;], channel);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Negative channels are popular for script communications because the client is unable to chat directly on those channels (&amp;quot;/-xxxx message&amp;quot; won&amp;#039;t chat &amp;quot;message&amp;quot; on channel &amp;quot;-xxxx&amp;quot;, it will chat &amp;quot;/-xxxx message&amp;quot; on channel zero). The only way to do so prior to llTextBox was to use llDialog which was limited to 24 bytes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can be reasonably confident that all of your scripted objects have a unique chat channel with this small function: &amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
integer dialog_channel; // top of script in variables&lt;br /&gt;
 &lt;br /&gt;
integer channel() { // top of script in functions&lt;br /&gt;
    return (integer)(&amp;quot;0x&amp;quot;+llGetSubString((string)llGetKey(),-8,-1));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
dialog_channel = channel(); // somewhere in actual script execution, such as state_entry()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Appearance&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
If message requires more than 8 lines, a vertical scroll bar will appear in the dialog. &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
The message text can be formatted somewhat using &amp;quot;\n&amp;quot; (for newline) and &amp;quot;\t&amp;quot; (for tab). You can do nothing though to influence the font face, size or weight. &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
There is no way to change the actual size of the dialog, nor change its color.  &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
See Also &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Events&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[listen]]  &amp;lt;br&amp;gt;			&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llListen]]  &amp;lt;br&amp;gt;			&lt;br /&gt;
•  	[[llTextBox]] 	 &amp;lt;br&amp;gt;		&lt;br /&gt;
•  	[[llRegionSay]]  &amp;lt;br&amp;gt;			&lt;br /&gt;
•  	[[llWhisper]] 	– 	Sends chat limited to 10 meters 	 &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llSay]] 	– 	Sends chat limited to 20 meters 	 &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llShout]] 	– 	Sends chat limited to 100 meters  &amp;lt;br&amp;gt;	&lt;br /&gt;
•  	[[llInstantMessage]] 	– 	Sends chat to the specified user 	 &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llOwnerSay]] 	– 	Sends chat to the owner only 	 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Osgridadmin</name></author>
	</entry>
</feed>