// ===================================================================== // Vanisher · step 2 of 2 // skimi3d script library · https://grid.skimi3d.com/scripts/vanisher // // Goes inside whatever the Temporary Rezzer puts out. It waits for the // word to go, and then goes. // // This half exists because of a rule with no way round it: nothing can // delete an object from outside. A rezzer can put something out, but it // cannot take it back. Only the object itself can leave, so the object // has to be carrying something that is willing to do it. // // Plain LSL. Nine lines of it do the work. // ===================================================================== // --------------------------------------------------------------------- // Settings // --------------------------------------------------------------------- // Both halves of the kit have to agree on this number and this word. // Change them together or not at all. Change them at all only if you // are running two rezzers near each other that should not answer to // the same call. integer CHANNEL = -70714; string GO_AWAY = "vanish"; // Minutes after which it leaves anyway, even if nobody calls it. 0.0 // waits for the word for ever. // // It is worth setting. A rezzer that is deleted, or a region that // restarts at the wrong moment, leaves its object standing with nobody // left to call it home. float GIVE_UP_AFTER = 60.0; // Only obey the person who owns me. On by default: without it, anybody // running a copy of this kit could clear away your build by saying the // word within earshot. integer OWNER_ONLY = TRUE; // --------------------------------------------------------------------- // Everything below here is the machinery // --------------------------------------------------------------------- default { state_entry() { // Listening only to objects owned by the same person. The empty // name and empty key mean "anybody", and the owner test in the // event narrows it back down. llListen(CHANNEL, "", NULL_KEY, GO_AWAY); if (GIVE_UP_AFTER > 0.0) llSetTimerEvent(GIVE_UP_AFTER * 60.0); } listen(integer channel, string name, key who, string message) { if (OWNER_ONLY) { // `who` is the object that spoke. Whose object it is, is the // question that matters, and it is asked of the speaker // rather than trusted from the message. if (llGetOwnerKey(who) != llGetOwner()) return; } llDie(); } timer() { llDie(); } on_rez(integer start) { // The clock has to start again for each copy that is put out, // not once for the one sitting in the rezzer's Contents. llResetScript(); } }