OsMessageObject
From OpenSimulator
(Difference between revisions)
m (Add uppercase) |
|||
Line 3: | Line 3: | ||
|permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | |permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | ||
|delay=0 | |delay=0 | ||
− | |function_syntax= osMessageObject(key | + | |function_syntax= osMessageObject(key primID, string message) |
− | |ossl_example=This example consists of a sender script, and a | + | |ossl_example=This example consists of a sender script, and a receiver script. |
: '''Sender script''' | : '''Sender script''' | ||
<source lang = "lsl"> | <source lang = "lsl"> | ||
// ---------------------------------------------------------------- | // ---------------------------------------------------------------- | ||
// Example / Sample Script to show function use. | // Example / Sample Script to show function use. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// | // | ||
default | default | ||
Line 47: | Line 26: | ||
− | : ''' | + | : '''Receiver script''' |
<source lang = "lsl"> | <source lang = "lsl"> | ||
// Place this script in the Receiver prim. | // Place this script in the Receiver prim. | ||
Line 63: | Line 42: | ||
</source> | </source> | ||
|description= | |description= | ||
− | + | ''primID'' = the UUID of the prim you are messaging. | |
− | + | ''message'' = The String of data you want to send. | |
Sends a message to a prim identified by the given UUID, a script in the prim must implement the dataserver event handler. the dataserver event is passed the UUID of the calling prim and a string message. | Sends a message to a prim identified by the given UUID, a script in the prim must implement the dataserver event handler. the dataserver event is passed the UUID of the calling prim and a string message. |
Revision as of 11:58, 27 October 2021
osMessageObject(key primID, string message)
| |
primID = the UUID of the prim you are messaging.
message = The String of data you want to send. Sends a message to a prim identified by the given UUID, a script in the prim must implement the dataserver event handler. the dataserver event is passed the UUID of the calling prim and a string message. This is incompatible with the normal use of dataserver event on scripts on the receiving prim. | |
Threat Level | Low |
Permissions | ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER |
Extra Delay | 0 seconds |
Example(s) | |
This example consists of a sender script, and a receiver script.
// ---------------------------------------------------------------- // Example / Sample Script to show function use. // default { state_entry() { llSay(0, "Touch me to use osMessageObject to message an object"); } touch_end(integer total_num) { key kTargetObj = "UUID"; //INSERT A VALID Object UUID here string sSentence = "This message sent from a Sending object using osMessageObject"; osMessageObject(kTargetObj,sSentence); } }
// Place this script in the Receiver prim. default { state_entry() { llSay(0, "osMessageObject Receiver Ready\nPlease replace UUID in osMessageObject Script (line 31) kTargetObj = "+(string)llGetKey()); } dataserver(key query_id, string data) { llSay(0, "RECEIVER: The message received.\n\t query_id = "+(string)query_id+"\n\t msg = "+data); } } |