Vanisher
Goes inside whatever the Temporary Rezzer puts out. It waits for the word to go, and then goes. Nine lines do the work.
What it does
It listens on a private channel for one word, and when it hears it from an object belonging to the same person, it deletes itself and everything it is linked to. It also carries a clock of its own, so a copy whose rezzer was deleted, or whose region restarted at the wrong moment, still leaves eventually instead of standing there for ever. It checks who owns the speaker rather than trusting the message, which is what stops somebody else running a copy of this kit and clearing away your build by saying the word within earshot.
What you can build with it
It has no build of its own. It is the second half of Rez and clear away, and the reason that kit is two scripts: nothing can delete an object from outside, so anything meant to be temporary has to be carrying something willing to do it.
How to use it
Settings you can change
4Edit these at the top of the script. Everything works on the defaults · change them only when you need to.
// =====================================================================
// 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();
}
}
Copy it, make a new script inworld, paste over what is there and save. Nothing here phones home.