Log Entries
• November 2007
• December 2007
• January 2008
• February 2008
• March 2008
• May 2008
• June 2008
• July 2008
• August 2008
• September 2008
• October 2008
• November 2008
• The history of the SL Dumpster
The first script sits in the outer box of the dispenser, (together with the notecard about the instructions on how to use it) processing the initial request and responding to visitors walking by.
list recent_avatars; add_avatar(string name) { if(!seen(name)) { recent_avatars += name; if (llGetListLength(recent_avatars) > 25) { recent_avatars = llDeleteSubList(recent_avatars,0,0); } } } integer seen(string name) { if(llListFindList(recent_avatars,[name]) > -1) { return TRUE; } return FALSE; } default { state_entry() { llSensorRepeat("", NULL_KEY, AGENT, 15, PI, 5); llSetText("Click here to get the decay script", <1.0,0,0>, 1.0); } sensor(integer total_number) { if(!seen(llDetectedName(0))) { // speak out loud! llSay(0,"Please touch to get the decay script, to be placed inside your trashed object."); // creates text hovering above the script distributor add_avatar(llDetectedName(0)); } } touch_start(integer total_number) { // Sends the message 0, "Touched.", key from requester to all scripts in this prim // that contain a link_message() event handler. llMessageLinked(2, 0, "Touched.", llDetectedKey(0)); // The 2 sends the message to the first linked prim only. } }
The second script receives the call for the decaying script and gives it to the requester.
// Receiver script, to be placed inside the inner linked object default { // Waits for another script to send a link message. link_message(integer sender_num, integer num, string str, key id) { // This line will pick out the first thing of the right type and give it to whomever triggered the event llGiveInventory(id,llGetInventoryName(INVENTORY_SCRIPT,0)); } }