Difference between revisions of "LlOwnerSay"
Jump to navigation
Jump to search
Void Singer (talk | contribs) m (-footnote +caveats +helpers) |
m (owner caching: small bytecode reduction, small increase of speed, readability unaffected. owner is unlikely to change mid execution.) |
||
Line 22: | Line 22: | ||
//-- any calls to llOwnerSay below it with uOwnerSayPlus | //-- any calls to llOwnerSay below it with uOwnerSayPlus | ||
uOwnerSayPlus( string vStrMsg ){ | uOwnerSayPlus( string vStrMsg ){ | ||
if (llKey2Name( | key owner = llGetOwner(); | ||
if (llKey2Name( owner )){ | |||
llOwnerSay( vStrMsg ); //-- single owner that the region still has a handle for | llOwnerSay( vStrMsg ); //-- single owner that the region still has a handle for | ||
}else if (llList2Key( llGetObjectDetails( llGetKey(), [OBJECT_GROUP] ), 0 ) == | }else if (llList2Key( llGetObjectDetails( llGetKey(), [OBJECT_GROUP] ), 0 ) == owner){ | ||
llWhisper( 0, "/me : " +vStrMsg ); //-- group owned, must send the message publicly | llWhisper( 0, "/me : " +vStrMsg ); //-- group owned, must send the message publicly | ||
}else{ | }else{ | ||
llInstantMessage( | llInstantMessage( owner, vStrMsg ); //-- single owner, not present, send them an IM | ||
} | } | ||
}</lsl> | }</lsl> |
Revision as of 15:17, 3 April 2011
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Caveats
- If msg is longer than 1024 bytes, it will be truncated to 1024 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 group.
Examples
<lsl>default {
touch_start(integer total_number) { 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 below it with uOwnerSayPlus
uOwnerSayPlus( string vStrMsg ){ key owner = llGetOwner(); if (llKey2Name( owner )){ llOwnerSay( vStrMsg ); //-- single owner that the region still has a handle for }else if (llList2Key( llGetObjectDetails( llGetKey(), [OBJECT_GROUP] ), 0 ) == owner){ llWhisper( 0, "/me : " +vStrMsg ); //-- group owned, must send the message publicly }else{ llInstantMessage( owner, vStrMsg ); //-- single owner, not present, send them an IM } }</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 |