Wind On Physical Object

Expired

// Wind affects avatar clothing/hair, trees, and can affect particles and flexible prims.
// Wind "naturally" (programatically) varies in velocity and direction.
// Wind does not cause friction. (from the wiki)
//
// This script takes the vector returned by llWind, which represents the
// speed and direction of the wind at the current position (it doesnt' use any
// offset hence 'ZERO_VECTOR'),
// and applys an impulse to the object to match it, simulating the impulse that
// would be applied by the wind.
//
// It doesnt really work well unless youre object is small/light enough to be actually
// moved by the impulse. Otherwise it tends to just sit there and vibrate.
//
// Of course the '/35' is the result of my own experimentation, you will probably
// want to play with this value until it suits your own object.
 
default
{
 
        state_entry()
        {
                llApplyImpulse(llWind(ZERO_VECTOR)/35,TRUE);
                llResetScript();
        }
 
}

 

Window Tinter

Expired

//Main Script (Send Unit) :
//Code:
integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons)
{
        menu_channel = -37641 ; // You can change the Channel as needed...to add more systems into one house, but dont forget to change the channels in the Window (Target) Scriot too)
        menu_handler = llListen(menu_channel,"","","");
        llDialog(user,title,buttons,menu_channel);
        llSetTimerEvent(5.0);
}
 
default
{
        touch_start(integer t)
        {
                menu(llDetectedKey(0),"Window Tinting System",["100","80","60","40","20","0"]);
        }
        timer()
        {
                llSetTimerEvent(0.0);
                llListenRemove(menu_handler);
        }
        listen(integer channel,string name,key id,string message)
        {
                if (channel == menu_channel)
                {
                        llSetTimerEvent(0.0);
                        llListenRemove(menu_handler);
                        if(message == "100")
                        {
                                llSay(menu_channel,"100");
                        }
                        else if(message == "80")
                        {
                                llSay(menu_channel,"80");
                        }
                        else if(message == "60")
                        {
                                llSay(menu_channel,"60");
                        }
                        else if(message == "40")
                        {
                                llSay(menu_channel,"40");
                        }
                        else if(message == "20")
                        {
                                llSay(menu_channel,"20");
                        }
                        else if(message == "0")
                        {
                                llSay(menu_channel,"0");
                        }
                }
        }
}
///END SCRIPT
 
//Here the target (aka Windows), put this script into them.
 
//START SCRIPT
default
{
        state_entry()
        {
                llListen( -37641, "", NULL_KEY, "" );
        }
 
        listen( integer channel, string name, key id, string message )
        {
                if ( message == "100" )
                {
                        llSetAlpha(1.0, ALL_SIDES);
                }
                else if ( message == "80" )
                {
                        llSetAlpha(0.8, ALL_SIDES);
                }
                else if ( message == "60" )
                {
                        llSetAlpha(0.6, ALL_SIDES);
                }
                else if ( message == "40" )
                {
                        llSetAlpha(0.4, ALL_SIDES);
                }
                else if ( message == "20" )
                {
                        llSetAlpha(0.2, ALL_SIDES);
                }
                else if ( message == "0" )
                {
                        llSetAlpha(0.0, ALL_SIDES);
                }
        }
}
//////END SCRIPT

 

Permissions

Expired

// Bromley College
// Linden Script Exhibition
 
// Code for Step 34 Poster
 
string anim = "dance1"; // animation to play
 
default
{
    touch_start(integer total_number) //wait for an avatar to touch the poster
    {
        llSay(0, "Respond to the dialog box and then touch the poster again");
        llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION); //ask permission to animate the avatar that touched the poster. The avatar's key is provided by the touch_start event in conjunction with the llDetectedKey(0) function.
 
        state new;
    }
}
 
state new
{
  touch_start(integer total_number)
    {
        if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) //if animate permission has been given start animation
        {
            llSay(0, "Animation beginning");
            llStartAnimation(anim);
            llSay(0, "I will become even more undignified than this... (King David)");
            state default;
        }
        if (! (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) //if animate permission has not been given
        {
             llSay(0, "Agent has not given permission");
             state default;
        }
    }
}
 
// End of code;

 

Land Filler

Expired

//After yesterdays "ultra lag" attack, We need to fill up our parcels so that they can't rez too many items and crash the sim.
 
//The concept is simple, replicate until fail and then delete x copys.
 
//I'll leave a full permission copy at yadni's junkyard.
 
//Note: The prim names must be exact.
 
//1. Go to a far away area or up high so that this does not cause lag.
//2. Create a blank, white, "Full bright" prim and name it "Land_Fill"
//3. Place the "Land_Fill_Die" script into the prim.
//4. Take it.
//5. Create a blank, white, "Full bright" prim and name it "Land_Filler"
//6. Place the "Rez_Array" script into the prim named "Land_Filler"
//7. Place "Land_Fill" into "Land_Filler"
//8. Enter 20 into the description field of "Land_Filler" to leave space for 20 prims.
//9. Touch it twice. The first touch clears out any leftovers.
 
//------------------------
 
// Rez to fill property - (description count)
// Released into the public domain by Grumble Loudon and LaserFur Leonov
 
//Rez and then touch to either rez or kill
 
//Note, The land max is not updated imedietly, so there will be a little
// time while no objects can be rezed.
 
integer m_RezLimit = 16384; //limit the number of prims created, just in case.
 
// you could also set this if you are on rented land and don't want to go over your limit.
 
integer m_channel = 25626;
 
list    m_OwnerNames = []; //Add other owner names here for groups.
 
//**************************************************  ************************************
integer m_RezNotKill = TRUE;
integer m_RezCount = 0;
vector  m_RezPos;
integer m_RezTimeout =0;
default
{
    state_entry()
    {
        m_OwnerNames += llKey2Name(llGetOwner());  // assumes owner is online when he rezes it
        llSetStatus(STATUS_BLOCK_GRAB, TRUE); //needed if we add a touch start
    }
    //**************************************************  ***********************************
    on_rez(integer StartPram)
    {
        llResetScript();
    }//on rez
    //**************************************************  ************************************
    touch_start(integer total_number)
    {
        key DetKey = llDetectedKey(0);
        string DetName = llKey2Name(DetKey);
 
        //owner info
        list FindName;
        FindName += DetName;   //name of avitar
        if (llListFindList( m_OwnerNames,  FindName) == -1) //not an owner
        {
            m_RezNotKill = !m_RezNotKill;  //toggle
 
            if (m_RezNotKill)
            {                   //Rez
                llOwnerSay("Starting");
                m_RezCount = 1;
                m_RezPos = llGetPos();
                m_RezPos.z += 0.5;
                llRezObject("Land_Fill",m_RezPos,<0,0,0>,<0,0,0,1>,m_RezCount); //start process
                m_RezTimeout = 0;
                llSetTimerEvent(1);
            }else{
                llOwnerSay("Killing all");
                llSay(m_channel,"2147483647");  //kill all
            };//if m_RezNotKill
        };// if owner
    }// touch_start
//**************************************************  ************************************
    object_rez(key id)// it worked. So there may be more prim space left
    {
        m_RezTimeout = 0;       //reset timeout
 
        if (m_RezNotKill)     //check just in case a touch canceled the rez
        {
            ++m_RezCount;           //next number
            if (m_RezCount ,<0,0,0,1>,m_RezCount); //do it again
            };
            llSetTimerEvent(1);         //just in case a lag caused a timeout and a then a Rez
        };
    } //object_rez
      //**************************************************  ************************************
    timer()
    {
        ++m_RezTimeout;
        if (m_RezTimeout > 5)      //rez failed so parcel is full
        {
            llSay(m_channel,llGetObjectDesc());  //kill x number
            llSetTimerEvent(0);                  //kill timer
            llOwnerSay("Done");
        };
    }//timer
}//