Alt Key Script on Collision

Expired

default
{
    collision_start(integer number)
    {
        llSay(0, "The key to who (or what) hit me is: " +(string)llDetectedKey(0));
    }
}

 

LSL ASCII

Expired

string ASCII = "             \n                   !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
integer ord(string chr)
{
    if(llStringLength(chr) != 1) return -1;
    if(chr == " ") return 32;
    return llSubStringIndex(ASCII, chr);
}
string chr(integer i)
{
    i %= 127;
    return llGetSubString(ASCII, i, i);
}

 

Inventory Counter

Expired

// Inventory Statistic By Zep Palen.
// Here is another use of llGetInventoryNumber to show a statistic in a hovertext
// For this script to work you must add a showlist and an excludelist to the Description of the item this script is in.
// The description field must be filled like follows: [showlist];[Excludelist]
// Example: 0,1,3,5,6,7,10,13,20,21;3,7,10
// in the example all types are shown, but only types 3,7 and 10 are counted as total. You can see in the 2 lists below which number means which type
//
// This script is free to use and modify as you wish - Zep Palen
//
list inv_types = [0, 1, 3, 5, 6, 7, 10, 13, 20, 21];
list inv_names = ["Textures", "Sounds", "Landmarks", "Clothings", "Objects", "Notecards", "Scripts", "Bodyparts", "Animations", "Gestures"];
processCountInventory()
{
list objDesc = llParseString2List(llGetObjectDesc(), [";"], []);
list showList = llParseString2List(llList2String(objDesc, 0), [","], []);
list excludeFromCount = llParseString2List(llList2String(objDesc, 1), [","], []);
string counted = "This Archive Contains: " +llGetObjectName();
//    string counted = "ITEM COUNTER";
integer i = ~llGetListLength(showList);
while (++i)
{
integer showItem = (integer)llList2String(showList, i);
integer sIndex = llListFindList(inv_types, [showItem]);
if (~sIndex)
counted += "\n" + llList2String(inv_names, sIndex) + ": " + (string)llGetInventoryNumber(showItem);
}
integer totalCount = llGetInventoryNumber(INVENTORY_ALL);
for (i = ~llGetListLength(excludeFromCount); ++i;)
{
integer exclItem = (integer)llList2String(excludeFromCount, i);
integer cIndex = llListFindList(inv_types, [(string)exclItem]);
if (~cIndex)
totalCount = totalCount - llGetInventoryNumber(exclItem);
}
counted += "\n \n" + "Total: " + (string)totalCount;
llSetText(counted, <1 ,1,0>, 1);
}
default
{
state_entry()
{
processCountInventory();
}
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
processCountInventory();
}
}
}

 

Follower

Expired

default
{
    state_entry()
    {
        vector pos = llGetPos();
        llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y, FALSE);
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSleep(0.1);
        llMoveToTarget(pos,0.1);
        key id = llGetOwner();
        llSensorRepeat("",id,AGENT,20,2*PI,.4);
    }
 
    sensor(integer total_number)
    {
        vector pos = llDetectedPos(0);
        vector offset =<-1,0,0>;
        pos+=offset;
        llMoveToTarget(pos,.3);
    }
}