1 //originally written by Davide Byron
2 //this code is released under the GPLv3
4 // this script senda a copy of the object it is inside (provided that
5 // the object as a copy of itself inside) to anyone who requests it.
6 // this is an experimental thing and not full developed yet. but it works.
7 // a full featured standard for this things is gonna be developed soon.
9 //dedicated to Mealea, thanks for the passion you put into things and for being able to pass it on to me :)
11 //wich version of the EcoComm standard is in use, see
12 // http://www.slecosystem.com/wiki/index.php?title=Main_Page
14 // this part is not documented in the EWG wiki, as it is an improvement
15 // we would like to add. This MUST be considered just a preliminary version
16 // to test out the possibility of this approach.
17 // the full standard will come soon.
18 string ECO_COMM_VERSION
= "0x1";
20 string TREE_COPY_REQUEST
= "FractalTreeCopyRequest";
25 //credits for this function goes to Sera Rawley and her cannon plant script, thanks.
26 //calculates the channel used to talk to this creature, pretty much unique.
27 integer getEcoCommChannel(string Version
, key SourceKey
)
29 return (integer)(Version
+ llGetSubString(SourceKey
, 0, 6));
40 TREE_NAME
= llGetObjectName();
42 llListen( getEcoCommChannel( ECO_COMM_VERSION
, llGetKey() ), "", "", "" );
56 //if a fruit requests a copy of us, give it to him
57 listen( integer channel
, string name
, key id
, string message
)
59 //we only care that the message is the right one, no matter who is asking...
60 if( message
== TREE_COPY_REQUEST
)
62 llGiveInventory(id
, TREE_NAME
);