Prim Property Scrubber ( V2 )

Written by Kitsune

Just drop it onto/into the prim you want to clean of a property and choose from the menu which properties to remove either 1 at a time or all at once.

 

 

// V2 //
 
key owner;
 
integer passes = 0;
 
integer channel;
 
list properties = ["All",         // All the properties listed below.
                   "Text",        // Floating text. Used to display text typically above a prim.
                   "Particles",   // Used in "Poofers" for example.
                   "TextureAnim", // Texture Animation. Used to make textures on faces of prims move.
                   "Sit Target",  // Used in seats and poseballs. Sets an alternative sit position than the default.
                   "Mouselook",   // Forced Mouselook. Used to force an agents view to mouselook when sitting on the prim.
                   "Sit Text",    // Text other than the default "Sit Here" shown on the right click pie menu.
                   "Touch Text",  // Text other than the default "Touch" shown on the right click pie menu.
                   "Status's",    // There are many status's that can be set in prims. See the wiki (llSetStatus) for details.
                   "Sound",       // Looping sound emitting from the prim.
                   "Light"];      // Light emitting from the prim.
 
RP(integer i)
{
    ++passes;
    if(i == 1)
    llSetText("", <0.0,0.0,0.0>, 0.0);
    else if(i == 2)
    llParticleSystem([]);
    else if(i == 3)
    llSetTextureAnim(0, -1, 0, 0, 0.0, 0.0, 1.0);
    else if(i == 4)
    llSitTarget(<0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>);
    else if(i == 5)
    llForceMouselook(0);
    else if(i == 6)
    llSetSitText("");
    else if(i == 7)
    llSetTouchText("");
    else if(i == 8)
    {
        llSetStatus(14, 1);
        llSetStatus(251, 0);
    }
    else if(i == 9)
    llStopSound();
    else if(i == 10)
    llSetPrimitiveParams([23, 0, <0.0,0.0,0.0>, 0.0, 0.0, 0.0]);
}
 
RemoveProperty(integer i)
{
    if(!i)
    {
        while(i < 10)
        RP(++i);
        RemoveScript();
    }
    else
    RP(i);
    if(passes < 10)
    llDialog(owner, "\nRemove Properties", ["Finished"] +
    (properties = llListReplaceList(properties, ["-"], i, i)), channel);
    else
    RemoveScript();
}
 
RemoveScript()
{
    llRemoveInventory(llGetScriptName());
}
 
default
{
    state_entry()
    {
        owner = llGetOwner();
        llListen((channel = (llRound(llFrand(-10000000)) - 100000)), llKey2Name(owner), owner, "");
        llDialog(owner, "\nRemove Properties", ["Finished"] + properties, channel);
        llSetTimerEvent(60.0);
    }
    listen(integer chan, string name, key id, string msg)
    {
        llSetTimerEvent(60.0);
        integer index = 0;
        if((index = llListFindList(properties, [msg])) != -1)
        {
            if(msg != "-")
            RemoveProperty(index);
            else
            llDialog(owner, "\nRemove Properties", ["Finished"] + properties, channel);
        }
        else if(msg == "Finished")
        RemoveScript();
    }
    timer()
    {
        llOwnerSay("Removing script since you're not using it.");
        RemoveScript();
    }
}