// Davan Camus 2006.11.19 // Safety-script for replicated objects // // Rezzing objects is inherently risky; you can easily // end up with a *lot* of prims... sometimes by accident. // // It's a good idea to include a quick-delete method // on them. This script lets you selectively remove them. // // commands are as follows: // derez -- derez // derez 5 -- derez if we are younger than 5 seconds // derez fish -- derez if my name is fish // // in every case, if the derez affects us, pass it on before derezzing. // if it's not for us, DONT pass it on. That would become a loop! // integer gCommandChannel = 1; default { // allow rez-override of the channel on_rez(integer param) { if(param != 0) gCommandChannel = param; llResetScript(); } state_entry() { llListen(gCommandChannel,"",llGetOwner(),""); } listen(integer channel,string name,key id,string message) { list messageL = llParseString2List(message,[" "],[]); string cmd = llToLower(llList2String(messageL,0)); integer arg1 = llList2Integer(messageL,1); string arg1S = llList2String(messageL,1); integer doDerez = 0; if(cmd == "derez") { if(arg1 != 0) { if(llGetTime() < arg1) doDerez = 1; } else if(arg1S != "") { if(llGetObjectName() == arg1S) doDerez = 1; } else doDerez = 1; } if(doDerez) { llShout(gCommandChannel,message); // pass it on llSleep(1); // time for the shout to shout llDie(); } } }