WHY? Because it took me a long time to hunt down and find bits and pieces of code to figure out what I wanted and how to write it all myself into very simple, no nonsense code as I am trying to learn from scratch and learn my way up.
I'm hoping this will help others like myself that are trying to understand scripting from a very basic level and see just how the commands so what they do and more importantly WHY.
Some of the fantastic scripts in here are so awesome and work so great, but new scripters can't follow them so here we go. Any and all scripters are welcome to tear apart my scripts at the seams as I'm sure they aren't the best.
1) Easy-Cheez door with timed automatic close.
CODE
// Easy-Cheez Door Script with llSleep timer Auto-Close
// Haplo Voss
// -----------------
// Right off the bat, let's make a short and
// sweet timer to close the door after us.
//
Close()
{
rotation rot = llGetLocalRot();
llSleep(6);
rot.s = 1;
rot.x = 0;
rot.z = 0;
rot.y = 0;
llSetLocalRot(rot);
llResetScript();
}
// Ok that's out of the way. On with the door!
default
{
touch_start(integer total_number)
{
rotation rot = llGetLocalRot(); // Get current variables
// of objects location, and
if (rot.s > 0.6) // load them into an array
{ // called rot
rot.s = 0.707107; //x, y, z, are obvious,
rot.x = 0; //s is basically a way to tell
rot.y = -0.707107; //SL that here is a point in space
rot.z = 0; //to measure all of that from.
llSetLocalRot(rot); //We have our own coordinates, so set the
Close(); //Object where we want it to "Open" when touched,
} //then hop up to "Close()" to pause and revert
//back to our original coordinates where the
//door is in a "closed" state and start over.
//Note: You only need the 'z' and 'y' variable for Vertical doors
//That swing up and down liike a bar flap door. Otherwise 's' and 'x'
//Are all you need for a normal front porch swinging door for example.
else
{
rot.s = 1; //Basically the main reason this is here is if
rot.x = 0; //you or someone were to accidently move or
rot.y = 0; //rotate your door slightly out of whack, then
rot.z = 0; //the script is going to "Close" it irregardless
//of what state it's in when you touch it.
}
llSetLocalRot(rot); //Finish off by telling the door to move
//to its current assigned coordinates as per the script
}
}
//So basically the end result is: Touch the door and it checks to
//see if it is within the guidelines of where it should be to open / pause
//and close again. If the door is not in a closed state, or it a little
//wonky due to some sort of toying around, then it will close the
//wonky anyway and start over. That's it!
//Enjoy. Hope the info made sense, I treid to keep it as informal and
//plain english as possible. Feel free to IM me if you like, I'm by no
//means a Good scripter, but if you need help scripting doors, lights,
//things simple like that from a fellow noob, lemme know.
//All you experts out there... if you find something exceedingly inefficient
//about this little script, then by all means rip it up and spit out the
//much better version! ;) C-me!
2) How to get the coordinates of that door!! This is straight from the SL Wiki. Just put up your door, drop this script into it, click on it, and it will tell you your values to plug into the Easy-Cheez script.
CODE
default
{
touch_start(integer total_number)
{
rotation rot = llGetLocalRot();
string z = (string)rot.z;
string s = (string)rot.s;
string x = (string)rot.x;
string y = (string)rot.y;
llSay (0, "z = " + z + ", s = " + s + "x = " + x + "y = " + y);
}
}
If you just drop this into a single rectangular prim it will rotate in the center. Make your door, then add a thin 'door-jam' piece to one side and link the two together. The smaller prim being the root now, drop in the script and you are good to go.
LIGHTS CAMERA -- Ok.. Just Lights!
3) Light switch and as many lights as you can muster. Easy-Cheez-Light script
Use it for anything in particular, just be careful to use a whacky channel
Or better yet, use a channel calculation method for even better safety - **
By safety I mean safe from other scripts accidently coinciding and messing up
Yours on the same channel. Whether it be by mistake or otherwise

Enjoy -
CODE
//Easy-Cheez Shout - Control Script I wrote for my lights in the Pub.
//Haplo Voss
integer LtSwitch = FALSE;
default
{
touch_start(integer total_number)
{
if(LtSwitch == FALSE)
{
LtSwitch = TRUE;
llShout(1701, "On");
}
else
{
LtSwitch = FALSE;
llShout(1701, "Off");
}
}
}
OKOKOK... here is the drop-in script for your satellite lights. Nice and separated out.

CODE
default
{
state_entry()
{
llListen(1701,"","","");
}
listen(integer channel, string name, key id, string message)
{
if(message == "On")
{
llSetPrimitiveParams ([PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 10.0, 25.0, 0.75] );
}
else
{
if(message == "Off");
llSetPrimitiveParams ([PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 0.0, 3.0, 0.75] );
}
}
}
// 10 = Intensity
// 25 = coverage area
//.75 = drop off / fade out of light as it gets farther away from the
// light source. Play around with the values.. it's pretty fun.
// Change your world to midnight and put a light source behind a
// transparency... fun stuff to mess around with.
//------------------------
ENJOY!
* Remember that using " llShout " has a limited range. I think around 30m. So if your lights are going to be REALLY FAR away... don't get frustrated, just keep looking! *