LlOwnerSay: Difference between revisions
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) mNo edit summary |
Omei Qunhua (talk | contribs) m User function name did not match the instructions in the preceding comments |
||
| Line 26: | Line 26: | ||
// llOwnerSay extension for preventing silent failures | // llOwnerSay extension for preventing silent failures | ||
// paste this code at the top of the script and replace | // paste this code at the top of the script and replace | ||
// any calls to llOwnerSay | // any calls to llOwnerSay with uOwnerSayPlus | ||
uOwnerSayPlus(string inputString) | |||
{ | { | ||
key owner = llGetOwner(); | key owner = llGetOwner(); | ||
| Line 37: | Line 37: | ||
// group owned, must send the message publicly | // group owned, must send the message publicly | ||
else if (llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0) == owner) | else if (llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0) == owner) | ||
llWhisper( | llWhisper(0, "/me : " + inputString); | ||
// single owner, not present, send them an IM | // single owner, not present, send them an IM | ||
else | else | ||
Revision as of 05:34, 15 December 2012
| LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Caveats
- If msg is longer than 1023 bytes, it will be truncated to 1023 bytes.
- Silently fails ~45 seconds after the owner leaves the region the object is in.
- Silently fails when the object to which the script is attached is deeded to a group.
- Some viewers do not display llOwnerSay text when msg is empty ("").
Examples
<lsl> default {
touch_start(integer num_detected)
{
llOwnerSay("Ouch!");
}
}
</lsl>Useful Snippets
<lsl> // llOwnerSay extension for preventing silent failures // paste this code at the top of the script and replace // any calls to llOwnerSay with uOwnerSayPlus
uOwnerSayPlus(string inputString) {
key owner = llGetOwner();
// single owner that the region still has a handle for
if (llKey2Name(owner))
llOwnerSay(inputString);
// group owned, must send the message publicly
else if (llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0) == owner)
llWhisper(0, "/me : " + inputString);
// single owner, not present, send them an IM
else
llInstantMessage(owner, inputString);
} </lsl>
See Also
Functions
| • | llRegionSay | – | Sends chat region wide | |
| • | llWhisper | – | Sends chat limited to 10 meters | |
| • | llSay | – | Sends chat limited to 20 meters | |
| • | llShout | – | Sends chat limited to 100 meters | |
| • | llInstantMessage |
Articles
| • | Limits | – | SL limits and constrictions |