Who Is Online

1
Online

Saturday, 18 November 2017 21:01

Box Emptier Script

//Free box emptier. This script is provided free as in beer. If you paid for it, please contact Eloise Pasteur to tell her.

//Usage: Name the box something suitable for the contents, e.g. Class notes for Integral Calculus. Put whatever you want in the box you choose (you can texture it etc. as you like). This script will 1) automatically put hovertext over the prim saying touch me for notes about... and the name of the object. When the users touch it, they get all the items (except this script) you put in the object, in a folder called whatever you call the box. If you want to force the name to update after a change, just change the inventory - renaming this script for example.


list contents;

buildList()
{
    contents=[];
    integer i;
    integer num=llGetInventoryNumber(INVENTORY_ALL);
    while(i<num)
    {
        string item=llGetInventoryName(INVENTORY_ALL, i);
        if(item!=llGetScriptName())
        {
            contents+=item;
        }
        ++i;
    }
}

default
{
    state_entry()
    {
        buildList();
        llSetText("Touch Me!  You will get a\nfolder called"+llGetObjectName(), <0.7, 0.7,0.7>, 1.0);
    }

    touch_start(integer num)
    {
        integer i;
        while(i<num)
        {
            llGiveInventoryList(llDetectedKey(i), llGetObjectName(), contents);
            ++i;
        }
    }
    changed(integer change)
    {
        if(change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }
}

Flash Scratch to SL - Your Scripting Tool

Script ImageNeed to write a LSL script and don't know how to script?  I know I hate trying to get my head around LSLS when I an in a time crunch. So why not give Flash Scratch a try! Its a great tool for learning and scoding your own scripts for Second Life without having to pay someone to do it and without a crash course in LSL

A Huge thanks to John Bennet of ATLAS Institute at University of Colorado and Eric Rosenbaum at MIT for writing Scratch for SL to begin with.

Read more: Flash Scratch to SL - Your Scripting Tool