Shows a dialog box on avatar's screen with the text message. It contains a text box for input, any text that is entered is said by avatar on channel when the "Submit" button is clicked.
void llTextBox( key avatar, string message, integer channel );
Forced delay: 1.0 seconds. Energy: 10.0.
| Channel Constant | Description | |
|---|---|---|
| DEBUG_CHANNEL | 0x7FFFFFFF | Chat channel reserved for script debugging and error messages, broadcasts to all nearby users. |
| PUBLIC_CHANNEL | 0x0 | Chat channel that broadcasts to all nearby users. This channel is sometimes referred to as: open chat, local chat and public chat. |
llTextBox(avatar_key," \n",dialog_channel);integer gListener;
default
{
touch_start(integer total_number)
{
// See 'discussion' page for more comments on choosing a channel and possible left-open listener
integer channel = -13572468;
// "" saves byte-code over NULL_KEY
gListener = llListen( channel, "", "", "");
llTextBox(llDetectedKey(0), "Some info text for the top of the window...", channel);
}
listen(integer channel, string name, key id, string message)
{
llListenRemove(gListener);
llSay(0, "You wrote: " + message);
}
}
If the user hits Enter before clicking the "Submit" button, there will be a final carriage return in the message. In the rare event that this could be a problem, it is easily removed:
message = llStringTrim(message,STRING_TRIM);
Instead of mouse clicking: "Submit", you can use keyboard keys: press Tab and then Enter
Introduced in 568
indra/llcommon/lllslconstants.h:189 <cpp>// llTextBox() magic token string - yes this is a hack. sue me. const std::string TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!";</cpp>