Don't click here unless you want to be banned.

LSL Wiki : ExampleArgumentMultiplexing

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
Eg, sending a linked message:

list command=["DOSOMETHING",llGetKey(),llGetPos(),TRUE];
llMessageLinked( LINK_ROOT, 0, llDumpList2String(command, "-=-"), "" );

This sends command "DOSOMETHING" followed by a key, a vector and an integer.

When you're receiving this, you can do this:

link_message(integer sender_num, integer num, string str, key id)
{
     list Arguments = llParseStringKeepNulls( str, ["-=-"], [] );
     string Command = llList2String( Arguments, 0 );

     if( Command == "DOSOMETHING" )
     {
          key kSenderKey = (key)llList2String( Arguments, 1 );
          vector vSenderPos = (vector)llList2String( Arguments, 2 );
          integer bSomeInteger = (integer)llList2String( Arguments, 3 );
          ...
     }
     else ...
}

The great thing about this is that you can send any data type, including strings with spaces.
There are 5 comments on this page. [Display comments/form]