Add half dozen scripts
This commit is contained in:
3
Advanced Tree Planter/- Advanced Tree Planter.sol
Normal file
3
Advanced Tree Planter/- Advanced Tree Planter.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="- Advanced Tree Planter">
|
||||
<Project name="Advanced Tree Planter V3.0" path="Advanced Tree Planter V3.0\Advanced Tree Planter V3.0.prj" active="true"/>
|
||||
</Solution>
|
||||
@@ -0,0 +1,6 @@
|
||||
<Project name="Advanced Tree Planter V3.0" guid="5b149f5c-f1a2-40e8-9a0a-0a870117f668">
|
||||
<Object name="Object" guid="d4a77120-44c9-41d5-98ee-f6e22a5afab7" active="true">
|
||||
<Script name="Script.lsl" guid="041bfe93-5952-44f2-8e6b-491ed1c5c706">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
@@ -0,0 +1,93 @@
|
||||
// :NAME:Advanced Tree Planter V3.0
|
||||
// :AUTHOR:CyberGlo CyberStar
|
||||
// :KEYWORDS:
|
||||
// :REV:3.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:This device will plant an entire forrest in the 0,0 to 256,256 range (can be changed). It will plant trees at different heights in accordance with the land height level.
|
||||
// :CATEGORY:Tree
|
||||
// :CODE:
|
||||
|
||||
// This device will plant an entire forrest in the 0,0 to 256,256 range (can be changed). It will plant trees at different heights in accordance with the land height level.
|
||||
// You've never seen a forrest like this, it's truly beautiful when finished.
|
||||
// Be sure to understand this script fully.
|
||||
// step 1: put script in cube
|
||||
// step 2: put several varieties of FULL COPY Trees in the cube.
|
||||
// step 3: click the cube.
|
||||
// Note: If I were you I would make all the trees you put in the cube phantom, this makes it much easier on the physics engine of your simulator.
|
||||
|
||||
|
||||
integer gIntX;
|
||||
integer gIntY;
|
||||
integer gIntZ;
|
||||
|
||||
integer gIntStartX;
|
||||
integer gIntStartY;
|
||||
integer gIntEndX;
|
||||
integer gIntEndY;
|
||||
list gListInventoryList;
|
||||
rotation gRotRelative = <0.707107, 0.0, 0.0, 0.707107>;
|
||||
|
||||
float gFltPlantProbability;
|
||||
float gFltRandMax;
|
||||
integer gIntTreePick;
|
||||
string gStrTreeName;
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
}
|
||||
|
||||
touch_start(integer param)
|
||||
{
|
||||
gIntStartX=0;
|
||||
gIntStartY=0;
|
||||
gIntEndX = 256;
|
||||
gIntEndY = 256;
|
||||
gFltPlantProbability = .5;
|
||||
integer count = llGetInventoryNumber(INVENTORY_OBJECT);
|
||||
gFltRandMax = (float)count;
|
||||
gIntZ = 0;
|
||||
string gStrTreeName;
|
||||
for (gIntStartX=2;gIntStartX<gIntEndX;gIntStartX+=4)
|
||||
{
|
||||
for (gIntStartY=2;gIntStartY<gIntEndY;gIntStartY+=4)
|
||||
{
|
||||
gIntX = gIntStartX;
|
||||
gIntY = gIntStartY;
|
||||
llSetRegionPos(<gIntX,gIntY,gIntZ>);
|
||||
//llOwnerSay((string)gIntX + " " +(string)gIntY);
|
||||
llSetText("X: " + (string)gIntX + " Y: " + (string)gIntY+ " Z: " + (string)gIntZ, <1,1,1>, 1.0);
|
||||
integer gIntTreePick = (integer) llFrand(gFltRandMax+1);
|
||||
float fltDoIRez = llFrand(1.0);
|
||||
if (fltDoIRez < gFltPlantProbability)
|
||||
{
|
||||
gStrTreeName = llGetInventoryName(INVENTORY_OBJECT,gIntTreePick);
|
||||
llSleep(3.0);
|
||||
if (gStrTreeName != "")
|
||||
{
|
||||
vector vecNowPos = llGetPos();
|
||||
float fltLandHeight = osGetTerrainHeight(vecNowPos.x,vecNowPos.y);
|
||||
integer intNewX = (integer)vecNowPos.x;
|
||||
integer intNewY= (integer)vecNowPos.y;
|
||||
integer intNewZ=(integer)fltLandHeight;
|
||||
vecNowPos = <intNewX,intNewY, intNewZ>;
|
||||
llSetRegionPos(vecNowPos);
|
||||
|
||||
llOwnerSay("I planted: " + gStrTreeName);
|
||||
if (gStrTreeName == "TreeSP")
|
||||
{
|
||||
llRezObject(gStrTreeName, llGetPos() + <0.0,0.0,3.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
llRezObject(gStrTreeName, llGetPos() + <0.0,0.0,8.5>, <0.0,0.0,0.0>, gRotRelative, 0);
|
||||
}
|
||||
llSleep(3.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
llOwnerSay("I have finished planting Trees.");
|
||||
}
|
||||
}
|
||||
3
Colorpicker/Colorpicker.sol
Normal file
3
Colorpicker/Colorpicker.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Colorpicker">
|
||||
<Project name="Colorpicker" path="Colorpicker\Colorpicker.prj" active="true"/>
|
||||
</Solution>
|
||||
6
Colorpicker/Colorpicker/Colorpicker.prj
Normal file
6
Colorpicker/Colorpicker/Colorpicker.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="Colorpicker" guid="70c2edb1-475a-4316-8f24-ea8f91e1b047">
|
||||
<Object name="Object" guid="293fa598-8f67-44c2-b22c-db2ae06ea784" active="true">
|
||||
<Script name="Script.lsl" guid="5e267ec3-dbff-4c7c-9a0f-a22f12a41172">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
129
Colorpicker/Colorpicker/Object/Script.lsl
Normal file
129
Colorpicker/Colorpicker/Object/Script.lsl
Normal file
@@ -0,0 +1,129 @@
|
||||
// :CATEGORY:Color
|
||||
// :NAME:COlor Picker
|
||||
// :AUTHOR:Anonymous
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:
|
||||
// click a color and a brightness then click the preview to get an llOwnerSay with the color: ) <3
|
||||
// :CODE:
|
||||
//script found on a long lost forum and is by Anonymous
|
||||
//click a color and a brightness then click the preview to get an llOwnerSay with the color: ) <3
|
||||
float hue = 0.0; float lum = 0.5; float sat = 1.0;
|
||||
|
||||
integer start_face;
|
||||
|
||||
//hsl to rgb steps take from http://130.113.54.154/~monger/hsl-rgb.html
|
||||
vector hsl_to_rbg(float h, float s, float l) {
|
||||
|
||||
vector rbg;
|
||||
float temp1;
|
||||
float temp2;
|
||||
|
||||
if(l < .5)
|
||||
temp2 = l*(1.0+s);
|
||||
else
|
||||
temp2 = l+s-l*s;
|
||||
|
||||
temp1 = l*2.0-temp2;
|
||||
|
||||
float Rtemp3 = h+1.0/3.0;
|
||||
if(Rtemp3 < 0.0)
|
||||
Rtemp3 = Rtemp3+1.0;
|
||||
else if(Rtemp3 > 1.0)
|
||||
Rtemp3 = Rtemp3-1.0;
|
||||
|
||||
float Gtemp3 = h;
|
||||
if(Gtemp3 < 0.0)
|
||||
Gtemp3 = Gtemp3+1.0;
|
||||
else if(Gtemp3 > 1.0)
|
||||
Gtemp3 = Gtemp3-1.0;
|
||||
|
||||
float Btemp3 = h-1.0/3.0;
|
||||
if(Btemp3 < 0.0)
|
||||
Btemp3 = Btemp3+1.0;
|
||||
else if(Btemp3 > 1.0)
|
||||
Btemp3 = Btemp3-1.0;
|
||||
|
||||
if(6.0*Rtemp3 < 1.0)
|
||||
rbg.x = temp1+(temp2-temp1)*6.0*Rtemp3;
|
||||
else if(2.0*Rtemp3 < 1.0)
|
||||
rbg.x = temp2;
|
||||
else if(3.0*Rtemp3 < 2.0)
|
||||
rbg.x = temp1+(temp2-temp1)*((2.0/3.0)-Rtemp3)*6.0;
|
||||
else
|
||||
rbg.x = temp1;
|
||||
|
||||
if(6.0*Gtemp3 < 1.0)
|
||||
rbg.y = temp1+(temp2-temp1)*6.0*Gtemp3;
|
||||
else if(2.0*Gtemp3 < 1.0)
|
||||
rbg.y = temp2;
|
||||
else if(3.0*Gtemp3 < 2.0)
|
||||
rbg.y = temp1+(temp2-temp1)*((2.0/3.0)-Gtemp3)*6.0;
|
||||
else
|
||||
rbg.y = temp1;
|
||||
|
||||
if(6.0*Btemp3 < 1.0)
|
||||
rbg.z = temp1+(temp2-temp1)*6.0*Btemp3;
|
||||
else if(2.0*Btemp3 < 1.0)
|
||||
rbg.z = temp2;
|
||||
else if(3.0*Btemp3 < 2.0)
|
||||
rbg.z = temp1+(temp2-temp1)*((2.0/3.0)-Btemp3)*6.0;
|
||||
else
|
||||
rbg.z = temp1;
|
||||
|
||||
return rbg;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
default {
|
||||
|
||||
state_entry()
|
||||
{
|
||||
llSetPrimitiveParams([
|
||||
PRIM_SIZE, <.5,.4,.01>,
|
||||
PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_SQUARE, <0,1,0>, 0.0, <0,0,0>, <.8,1,0>, <.02,0,0>,
|
||||
PRIM_TEXTURE, ALL_SIDES, (key)"5748decc-f629-461c-9a36-a35a221fe21f", <1,1,0>, <0,0,0>, 0.0,
|
||||
PRIM_TEXTURE, 0, (key)"404e4461-8a22-fbf7-7652-4b81dc7da325", <1,1,0>, <0,0,0>, 0.0,
|
||||
PRIM_TEXTURE, 2, (key)"01c02d68-dfb0-d907-7397-cba857c61144", <1,1,0>, <0,0,0>, -PI_BY_TWO]);
|
||||
}
|
||||
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
start_face = llDetectedTouchFace(0);
|
||||
if(start_face == 4)
|
||||
llOwnerSay((string)hsl_to_rbg(hue, sat, lum));
|
||||
}
|
||||
|
||||
touch(integer total_number)
|
||||
{
|
||||
vector st = llDetectedTouchST(0);
|
||||
integer face = llDetectedTouchFace(0);
|
||||
if(start_face != face) return;
|
||||
if(face == 0)
|
||||
{
|
||||
sat = st.y;
|
||||
hue = st.x;
|
||||
llSetColor(hsl_to_rbg(hue, sat, lum), 4);
|
||||
}
|
||||
else if(face == 2)
|
||||
{
|
||||
lum = st.x;
|
||||
llSetColor(hsl_to_rbg(hue, sat, lum), 4);
|
||||
}
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_OWNER)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// :SHOW:1
|
||||
// :CATEGORY:Animation
|
||||
// :NAME:Easy Ladder
|
||||
// :AUTHOR:Fred Beckhusen (Ferd Frederix)
|
||||
// :AUTHOR:Pedlar Decosta
|
||||
// :KEYWORDS:Ladder
|
||||
// :CREATED:2015-07-15 10:04:12
|
||||
// :EDITED:2016-05-02 11:59:18
|
||||
// :ID:1081
|
||||
// :NUM:1800
|
||||
// :REV:2
|
||||
@@ -15,74 +14,84 @@
|
||||
|
||||
// Rev 2: 12-18-2015 added region pos for return
|
||||
|
||||
/* Climb ladder
|
||||
http://community.secondlife.com/t5/Scripting/Ladder-Climb/td-p/256433
|
||||
Edited for opensimulator to unsit user at top via offset vector
|
||||
///* Climb ladder
|
||||
//http://community.secondlife.com/t5/Scripting/Ladder-Climb/td-p/256433
|
||||
//Edited for opensimulator to unsit user at top via offset vector
|
||||
|
||||
BVH: climb-rope
|
||||
//BVH: climb-rope
|
||||
|
||||
Fred Beckhusen (Ferd Frederix)z - removed cruft, added offsets and removed ugly hacks.
|
||||
//Fred Beckhusen (Ferd Frederix)z - removed cruft, added offsets and removed ugly hacks.
|
||||
|
||||
*/
|
||||
|
||||
//*/
|
||||
|
||||
float LADDERHEIGHT= 7.0; // how far to move up
|
||||
//Pedlar Decosta 2020 - edited it to use object description for the ladder height.
|
||||
//Added support to climb down using a negative number. Adjusted the variables accordingly.
|
||||
//Added appropriate sit text. For use in a poseball. 1 at the bottom and one at the top. They work indepently from each other.
|
||||
// Don't forget to reset scripts when you change the ladder height.
|
||||
|
||||
|
||||
float LADDERHEIGHT; // how far to move up
|
||||
float STEPHEIGHT = 0.25; // how far to move each step
|
||||
float OFFSET = 3; // tilt of the ladder;
|
||||
float OFFSET = 0; // tilt of the ladder;
|
||||
float Extra = 1; // extra move onto the roof or in the door before unsit
|
||||
|
||||
climbup()
|
||||
{
|
||||
|
||||
llSetAlpha(0,ALL_SIDES);
|
||||
llStopAnimation("sit");
|
||||
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
|
||||
|
||||
|
||||
integer i;
|
||||
vector original;
|
||||
float steps = LADDERHEIGHT / STEPHEIGHT;
|
||||
float offset = OFFSET / steps; // to one side
|
||||
|
||||
original = llGetPos();
|
||||
do
|
||||
{
|
||||
i++;
|
||||
vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
|
||||
llSetPos(newPos);
|
||||
} while (i <= (steps));
|
||||
|
||||
llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
|
||||
|
||||
llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
|
||||
llSetAlpha(0,ALL_SIDES);
|
||||
llStopAnimation("sit");
|
||||
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
|
||||
|
||||
if (llAvatarOnSitTarget() != NULL_KEY)
|
||||
{ // somebody is sitting on me
|
||||
llUnSit(llAvatarOnSitTarget()); // unsit him or her
|
||||
}
|
||||
|
||||
llSetRegionPos(original);
|
||||
llSetAlpha(1,ALL_SIDES);
|
||||
|
||||
integer i;
|
||||
vector original;
|
||||
float steps = LADDERHEIGHT / STEPHEIGHT;
|
||||
float offset = OFFSET / steps; // to one side
|
||||
|
||||
original = llGetPos();
|
||||
do
|
||||
{
|
||||
i++;
|
||||
vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
|
||||
llSetPos(newPos);
|
||||
} while (i <= (steps));
|
||||
|
||||
llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
|
||||
|
||||
llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));
|
||||
|
||||
if (llAvatarOnSitTarget() != NULL_KEY)
|
||||
{ // somebody is sitting on me
|
||||
llUnSit(llAvatarOnSitTarget()); // unsit him or her
|
||||
}
|
||||
|
||||
llSetRegionPos(original);
|
||||
llSetAlpha(1,ALL_SIDES);
|
||||
} // end climbup
|
||||
|
||||
default
|
||||
{
|
||||
|
||||
state_entry() {
|
||||
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if(change == CHANGED_LINK)
|
||||
{
|
||||
key avatar = llAvatarOnSitTarget();
|
||||
|
||||
if(avatar != NULL_KEY)
|
||||
{
|
||||
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
|
||||
climbup();
|
||||
}
|
||||
}
|
||||
} //end changed
|
||||
state_entry() {
|
||||
LADDERHEIGHT = (integer)llGetObjectDesc();
|
||||
llSetSitText("Climb");
|
||||
if(LADDERHEIGHT <=0){ STEPHEIGHT = -0.25;
|
||||
Extra = -1; llSetSitText("Descend");}
|
||||
// if(LADDERHEIGHT <=0){ STEPHEIGHT = -0.25;}
|
||||
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if(change == CHANGED_LINK)
|
||||
{
|
||||
key avatar = llAvatarOnSitTarget();
|
||||
|
||||
if(avatar != NULL_KEY)
|
||||
{
|
||||
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
|
||||
climbup();
|
||||
}
|
||||
}
|
||||
} //end changed
|
||||
} //end default
|
||||
|
||||
12
HTTP Database/HTTP Database/Object/Script.lsl
Normal file
12
HTTP Database/HTTP Database/Object/Script.lsl
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSay(0, "Hello, Avatar!");
|
||||
}
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
llSay(0, "Touched: "+(string)total_number);
|
||||
}
|
||||
}
|
||||
3
Magic Sensor/Magic Sensor.sol
Normal file
3
Magic Sensor/Magic Sensor.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Magic Sensor">
|
||||
<Project name="Magic Sensor" path="Magic Sensor\Magic Sensor.prj" active="true"/>
|
||||
</Solution>
|
||||
6
Magic Sensor/Magic Sensor/Magic Sensor.prj
Normal file
6
Magic Sensor/Magic Sensor/Magic Sensor.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="Magic Sensor" guid="20b73037-e759-4b82-ae54-df5458c0563d">
|
||||
<Object name="Object" guid="3361255d-6fd9-46ae-964a-a5ed9af89be5" active="true">
|
||||
<Script name="Script.lsl" guid="5e9f9091-5236-4791-bcf6-b1e7aeda3251">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
254
Magic Sensor/Magic Sensor/Object/Script.lsl
Normal file
254
Magic Sensor/Magic Sensor/Object/Script.lsl
Normal file
@@ -0,0 +1,254 @@
|
||||
// :CATEGORY:Sensor
|
||||
// :NAME:Mafic Sensor
|
||||
// :AUTHOR:CyberGlo Cyberstar
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:
|
||||
// Finds various scripted, unscripted and other objects and marks them, much like the More-Beacons menu
|
||||
// :CODE:
|
||||
|
||||
vector offset = < 2, 0, 1.25>;
|
||||
vector pos;
|
||||
vector vecNewPos;
|
||||
|
||||
key gKyOID;
|
||||
key gKySensedObject;
|
||||
key gKyOrb;
|
||||
|
||||
float fltDistApart;
|
||||
|
||||
list lstObjectNameList;
|
||||
list lstObjectKeyList;
|
||||
|
||||
string strDisplayString;
|
||||
string strObjectPos;
|
||||
string strButtonResponse;
|
||||
|
||||
integer gListener;
|
||||
integer gListener2;
|
||||
integer intSearchState;
|
||||
integer gIntTimedCount;
|
||||
integer gIntSearchIndex;
|
||||
|
||||
fnWarpPos(vector pos)
|
||||
{
|
||||
llSetRegionPos(pos);
|
||||
}
|
||||
|
||||
|
||||
fnBeamParticles(key gKySensedObject)
|
||||
{
|
||||
llParticleSystem([ PSYS_PART_FLAGS, 0 | PSYS_PART_EMISSIVE_MASK |
|
||||
PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK |
|
||||
PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK |PSYS_PART_TARGET_POS_MASK ,
|
||||
PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_EXPLODE,
|
||||
PSYS_PART_MAX_AGE, 1.0,
|
||||
PSYS_PART_START_COLOR,<1,0,0>,
|
||||
PSYS_PART_END_COLOR,<1,0,0>,
|
||||
PSYS_PART_START_SCALE,<0.1, 0.4, 0.1>,
|
||||
PSYS_PART_END_SCALE,<0.1, 0.2, 0.1>,
|
||||
PSYS_PART_START_GLOW, 0.3,
|
||||
PSYS_SRC_BURST_RATE,0.01,
|
||||
PSYS_SRC_ACCEL,<0.0, 0.0, 0.0>,
|
||||
PSYS_SRC_BURST_PART_COUNT,1,
|
||||
PSYS_SRC_BURST_RADIUS,0.03,
|
||||
PSYS_SRC_BURST_SPEED_MIN,0.10,
|
||||
PSYS_SRC_BURST_SPEED_MAX,0.50,
|
||||
PSYS_SRC_TARGET_KEY,gKySensedObject,
|
||||
PSYS_SRC_INNERANGLE,1.55,
|
||||
PSYS_SRC_OUTERANGLE,1.54,
|
||||
PSYS_SRC_OMEGA,<0.0, 0.0, 5.0>,
|
||||
PSYS_SRC_MAX_AGE,0.00,
|
||||
PSYS_PART_START_ALPHA,0.50,
|
||||
PSYS_PART_END_ALPHA,0.10
|
||||
]);
|
||||
}
|
||||
|
||||
updateParticles()
|
||||
{
|
||||
key gKySensor;
|
||||
llParticleSystem([ PSYS_PART_MAX_AGE,2,
|
||||
PSYS_PART_FLAGS,PSYS_PART_EMISSIVE_MASK|PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_TARGET_POS_MASK ,
|
||||
PSYS_SRC_TARGET_KEY,gKyOrb,
|
||||
PSYS_PART_START_COLOR,<1,0,0> ,
|
||||
PSYS_PART_END_COLOR, <1,0,0>,
|
||||
PSYS_PART_START_SCALE,<.125,.125,FALSE>,
|
||||
PSYS_PART_END_SCALE,<.01,.01,FALSE>,
|
||||
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
|
||||
PSYS_SRC_BURST_RATE,.02,
|
||||
PSYS_SRC_ACCEL, <0,0,0>,
|
||||
PSYS_SRC_BURST_PART_COUNT,1,
|
||||
PSYS_SRC_BURST_RADIUS,.0,
|
||||
PSYS_SRC_BURST_SPEED_MIN,.25,
|
||||
PSYS_SRC_BURST_SPEED_MAX,.25,
|
||||
PSYS_SRC_ANGLE_BEGIN,(float).5*PI,
|
||||
PSYS_SRC_ANGLE_END,(float).5*PI,
|
||||
PSYS_SRC_OMEGA, <0,0,1.0>,
|
||||
PSYS_SRC_MAX_AGE, 0,
|
||||
PSYS_SRC_TEXTURE, "smoke1",
|
||||
PSYS_PART_START_ALPHA, 1,
|
||||
PSYS_PART_END_ALPHA, 1
|
||||
]);
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
on_rez(integer parm)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
state_entry()
|
||||
{
|
||||
// llSetPrimitiveParams([PRIM_TYPE,PRIM_TYPE_SPHERE,PRIM_SIZE,<0.2,0.2,0.2>,PRIM_PHYSICS,1,PRIM_FULLBRIGHT,1,PRIM_POINT_LIGHT,1,<1,0,0>,1,10,5,PRIM_GLOW,0.3,PRIM_TEXTURE,0,"CLOUDS",<1,1,1>,<1,1,1>,0.0]);
|
||||
updateParticles();
|
||||
llSetStatus(STATUS_PHYSICS, TRUE);
|
||||
llSleep(0.1);
|
||||
llSetTimerEvent(0.5);
|
||||
gKyOID=llGetOwner();
|
||||
gKyOrb = llGetKey();
|
||||
}
|
||||
|
||||
touch_start(integer c)
|
||||
{
|
||||
llListenRemove(gListener);
|
||||
llListenRemove(gListener2);
|
||||
gListener = llListen(-99, "", gKyOID, "");
|
||||
llDialog(gKyOID, "\nPlease select Scan Type:", ["Active", "Passive", "Scripted","Legacy", "Display","Select", "Beam Off" ] , -99);
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
//CAN BE ACTIVE,PASSIVE,SCRIPTED,AGENT
|
||||
}
|
||||
|
||||
listen(integer chan, string name, key id, string msg)
|
||||
{
|
||||
lstObjectNameList = llList2List(lstObjectNameList,0,11);
|
||||
if (chan == -99)
|
||||
{
|
||||
if (msg == "Active")
|
||||
{
|
||||
intSearchState=2;
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
}
|
||||
if (msg == "Passive")
|
||||
{
|
||||
intSearchState=4;
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
}
|
||||
if (msg == "Legacy")
|
||||
{
|
||||
intSearchState=1;
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
}
|
||||
if (msg == "Display")
|
||||
{
|
||||
intSearchState =10;
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
}
|
||||
if (msg == "Scripted")
|
||||
{
|
||||
intSearchState =8;
|
||||
llSensorRepeat("", "", intSearchState, 30, PI, 2);
|
||||
}
|
||||
if (msg == "Select")
|
||||
{
|
||||
|
||||
llDialog(gKyOID, "\nPlease select Object:", lstObjectNameList , -98);
|
||||
gListener2 = llListen(-98, "", gKyOID, "");
|
||||
}
|
||||
if (msg == "Beam Off")
|
||||
{
|
||||
updateParticles();
|
||||
|
||||
}
|
||||
}
|
||||
if (chan == -98)
|
||||
{
|
||||
gIntSearchIndex = llListFindList(lstObjectNameList,msg);
|
||||
gKySensedObject = llList2Key(lstObjectKeyList,gIntSearchIndex);
|
||||
fnBeamParticles(gKySensedObject);
|
||||
}
|
||||
}
|
||||
sensor(integer number_detected)
|
||||
{
|
||||
strDisplayString = "";
|
||||
lstObjectNameList = [];
|
||||
lstObjectKeyList = [];
|
||||
integer intObjectNumber;
|
||||
for (; intObjectNumber < number_detected; intObjectNumber++)
|
||||
{
|
||||
string strObjectName = llDetectedName(intObjectNumber);
|
||||
key gKySensedObject = llDetectedKey(intObjectNumber);
|
||||
if (intObjectNumber< 12)
|
||||
{
|
||||
if (llListFindList(lstObjectNameList, [strObjectName]) == -1)
|
||||
{
|
||||
lstObjectNameList =(lstObjectNameList=[])+lstObjectNameList+[strObjectName];
|
||||
lstObjectKeyList = (lstObjectKeyList=[])+lstObjectKeyList+[gKySensedObject];
|
||||
// llOwnerSay(strObjectName);
|
||||
|
||||
list lstObjectNow = llGetObjectDetails(gKySensedObject, OBJECT_POS);
|
||||
vector vecObjectNow = llList2Vector (lstObjectNow,0);
|
||||
integer intVecX = (integer)vecObjectNow.x;
|
||||
integer intVecY = (integer)vecObjectNow.y;
|
||||
integer intVecZ = (integer)vecObjectNow.z;
|
||||
string strObjPosVec = "<"+(string)intVecX+" "+(string)intVecY+ " " + (string)intVecZ+">";
|
||||
strObjectPos = strObjPosVec;
|
||||
strDisplayString = strDisplayString +strObjectName + " \n";
|
||||
strObjectPos = "";
|
||||
//lstObjectNameList = [];
|
||||
//lstObjectKeyList = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
llSetText(strDisplayString,<1,1,1>,1.0);
|
||||
//strDisplayString = "";
|
||||
//lstObjectNameList = [];
|
||||
}
|
||||
changed(integer c)
|
||||
{
|
||||
if (c & CHANGED_OWNER)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
|
||||
timer()
|
||||
{
|
||||
// gIntTimedCount++;
|
||||
// if (gIntTimedCount == 1)
|
||||
// {
|
||||
// lstObjectNameList=[];
|
||||
// lstObjectKeyList=[];
|
||||
// strDisplayString="";
|
||||
// gIntTimedCount = 0;
|
||||
// }
|
||||
if (llGetAgentSize(gKyOID) == ZERO_VECTOR)
|
||||
{
|
||||
pos = <128,128,25>;
|
||||
llMoveToTarget(pos,0.4);
|
||||
}
|
||||
else
|
||||
{
|
||||
list det = llGetObjectDetails(gKyOID,[OBJECT_POS,OBJECT_ROT]);
|
||||
pos = llList2Vector(det,0);
|
||||
vecNewPos = llGetPos();
|
||||
fltDistApart =llVecDist(pos,vecNewPos);
|
||||
if (fltDistApart > 8)
|
||||
{
|
||||
llSetText((string)fltDistApart, <1,1,1>,1.0);
|
||||
pos += <2,0,1>;
|
||||
fnWarpPos(pos);
|
||||
|
||||
llSetText("",<0.1,0.1,0.1>,0.1);
|
||||
}
|
||||
rotation rot = (rotation)llList2String(det,1);
|
||||
vector worldOffset = offset;
|
||||
vector avOffset = offset * rot;
|
||||
pos += avOffset;
|
||||
if (pos.x < 0 ) { pos.x =1; }
|
||||
if (pos.x > 256 ) { pos.x = 256;}
|
||||
if (pos.y < 0 ) { pos.y = 1;}
|
||||
if (pos.y > 256 ) { pos.y = 256; }
|
||||
llMoveToTarget(pos,0.4);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
PawPrints/PawPrints.sol
Normal file
3
PawPrints/PawPrints.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="PawPrints">
|
||||
<Project name="PawPrints" path="PawPrints\PawPrints.prj" active="true"/>
|
||||
</Solution>
|
||||
6
PawPrints/PawPrints/PawPrints.prj
Normal file
6
PawPrints/PawPrints/PawPrints.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="PawPrints" guid="a8827ec8-79b5-4635-8f32-94af2173404c">
|
||||
<Object name="Pawprint Prim attach to foot" guid="7a75d157-321e-4276-9c48-756954d04d71" active="true">
|
||||
<Script name="Script.lsl" guid="12992910-812a-41c2-a50e-3c7a4d1e57e4">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
22
PawPrints/PawPrints/Pawprint Prim attach to foot/Script.lsl
Normal file
22
PawPrints/PawPrints/Pawprint Prim attach to foot/Script.lsl
Normal file
@@ -0,0 +1,22 @@
|
||||
// :CATEGORY:Particles
|
||||
// :NAME:Pawprints
|
||||
// :AUTHOR:CyberGlo CyberStar
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:
|
||||
//drop this script in a prim with a texture and wear it on your foot.
|
||||
// :CODE:
|
||||
|
||||
//PawPrints by CyberGlo CyberStar
|
||||
//drop this script in a prim with a texture and wear it on your foot.
|
||||
// you can make one for right and left foot if you like.
|
||||
// texture should be named "Paw"
|
||||
list gLstSys ;
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{ gLstSys = [7, 125, 0, 256, 1, <0.00,0.00,0.00>, 3, <0.00,0.00,0.00>, 5, <0.40,0.20,0.70>, 6, <0.40,0.40,0.70>, 9, 1, 13, 0.50, 8, <0.00,0.00,0.00>, 15, 1, 16, 0.10, 17, 0.10, 20, "", 10, 1.54, 11, 1.55, 21, <0.00,0.00,10.00>, 19, 0, 12, "Paw", 2, llGetKey(), 4, 1];
|
||||
llSetTimerEvent(3.0);
|
||||
}
|
||||
timer() { llParticleSystem(gLstSys); }
|
||||
}
|
||||
3
PostBox by Ana/PostBox by Ana.sol
Normal file
3
PostBox by Ana/PostBox by Ana.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="PostBox by Ana">
|
||||
<Project name="PostBox by Ana" path="PostBox by Ana\PostBox by Ana.prj" active="true"/>
|
||||
</Solution>
|
||||
6
PostBox by Ana/PostBox by Ana/PostBox by Ana.prj
Normal file
6
PostBox by Ana/PostBox by Ana/PostBox by Ana.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="PostBox by Ana" guid="9532efdb-be3b-448c-a7b8-511a7519b187">
|
||||
<Object name="PostBox" guid="1a7dfc2d-6bc3-46f1-84f9-a53b23ebd72e" active="true">
|
||||
<Script name="Script.lsl" guid="fe3c4606-8807-49e1-bd62-21970e4bec39">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
218
PostBox by Ana/PostBox by Ana/PostBox/Script.lsl
Normal file
218
PostBox by Ana/PostBox by Ana/PostBox/Script.lsl
Normal file
@@ -0,0 +1,218 @@
|
||||
// :AUTHOR:Anatova Akina
|
||||
// :CATEGORY:Email
|
||||
// :NAME:PostBox
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life,Opensim
|
||||
// :DESCRIPTION:
|
||||
// This script transform a prim to a Mail Box.
|
||||
// :CODE:
|
||||
|
||||
// --------------------------------------
|
||||
// This script transform a prim to a Mail Box.
|
||||
|
||||
// Folks can drop notecard to the box.
|
||||
// Read/unread information is displayed as hovering text.
|
||||
// You can copy/modify this script, it's totally free.
|
||||
// --------------------------------------
|
||||
//
|
||||
// 2021-04-22 - refactored / rewritten by Anatova Akina
|
||||
// * Resolved the 1 notecard not deleted bug
|
||||
// * Added admin access with IM notifications
|
||||
// * Uses changed() event better
|
||||
// * Compacted code, removed unecessary stuff
|
||||
// * Extended menu text & floatertext can be hidden
|
||||
// * Added delete notecards confirmation
|
||||
//
|
||||
//-------------------------------------------
|
||||
|
||||
////// USER SETTINGS: ///////////////////
|
||||
//
|
||||
// Add keys of admin access in the admin list as strings.
|
||||
// Object owner is added automatically.
|
||||
// Example:
|
||||
// list admin=["01234567-89ab-cdef-0123-456789abcdef", "01234567-89ab-cdef-0123-456789abcdef"];
|
||||
list admin=[];
|
||||
|
||||
// set this to FALSE to hide floater text
|
||||
integer floaterText=TRUE;
|
||||
|
||||
////// END of USER SETTINGS ////////////////
|
||||
|
||||
// column 1 = notecard name, column 2 = read by user
|
||||
list lMail = [];
|
||||
integer MAIL_UNREAD = 0;
|
||||
integer MAIL_READ = 1;
|
||||
|
||||
integer DIALOG_CHANNEL = -4938453;
|
||||
|
||||
string txtRefresh()
|
||||
{
|
||||
integer nTotalCard = llGetListLength(lMail)/2;
|
||||
integer nNotRead = 0;
|
||||
integer nCount = 0;
|
||||
|
||||
for (nCount = 0; nCount < llGetListLength(lMail); nCount += 2)
|
||||
{
|
||||
if (llList2Integer(lMail, nCount + 1) == MAIL_UNREAD)
|
||||
nNotRead += 1;
|
||||
}
|
||||
|
||||
// total string
|
||||
string cPost = (string)nTotalCard + " card";
|
||||
if (nTotalCard > 1)
|
||||
cPost += "s";
|
||||
cPost += " posted";
|
||||
|
||||
// unread string
|
||||
string cUnread = (string)nNotRead + " unread";
|
||||
|
||||
string text="Postbox\n" + cPost + "\n" + cUnread;
|
||||
|
||||
if (floaterText)
|
||||
llSetText(text, <.95, .75, 0>, 1);
|
||||
else
|
||||
llSetText("", <.95, .75, 0>, 1);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
notifyAdmin(string m) {
|
||||
integer i=llGetListLength(admin);
|
||||
while(i) {
|
||||
llInstantMessage(llList2Key(admin,i-1),m);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// scan and clean inventory of this object
|
||||
scanInventory(integer notify)
|
||||
{
|
||||
integer n;
|
||||
for (n=0;n<llGetInventoryNumber(INVENTORY_ALL);n++)
|
||||
{
|
||||
string cName = llGetInventoryName(INVENTORY_ALL, n);
|
||||
if (cName != llGetScriptName())
|
||||
{
|
||||
if (llGetInventoryType(cName) != INVENTORY_NOTECARD)
|
||||
{
|
||||
llSay(0, cName + " is not a notecard. Deleted.");
|
||||
llRemoveInventory(cName);
|
||||
n=n-1;
|
||||
}
|
||||
else if (cName)
|
||||
{
|
||||
if (llListFindList(lMail, [cName]) == -1)
|
||||
{
|
||||
// ok its a new card
|
||||
lMail += [cName, MAIL_UNREAD];
|
||||
llSay(0, "Notecard \"" + cName + "\" added to the mailbox. Thank you!");
|
||||
|
||||
if (notify)
|
||||
notifyAdmin("Notecard dropped: "+cName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
// Allowing dropping of object
|
||||
llAllowInventoryDrop(TRUE);
|
||||
|
||||
llListen(DIALOG_CHANNEL, "", NULL_KEY, "");
|
||||
|
||||
// add owner to admin access list
|
||||
admin+=(string) llGetOwner();
|
||||
|
||||
scanInventory(FALSE);
|
||||
txtRefresh();
|
||||
}
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
|
||||
key id = llDetectedKey(0);
|
||||
llRegionSayTo(id,0, "Drag and drop a notecard from inventory to post it to the staff");
|
||||
|
||||
// if admin access
|
||||
if (~llListFindList(admin,[(string) id]))
|
||||
{
|
||||
// Show a dialog
|
||||
llDialog(id,
|
||||
"\nWelcome admin to this "+ txtRefresh() + "\n\n" +
|
||||
"Unread: gives all unread notecards\n" +
|
||||
"Read: gives all read notecards\n" +
|
||||
"Delete: deletes all read notecards\n\n" +
|
||||
"What do you want to do ?", ["Unread", "Read","Delete"], DIALOG_CHANNEL);
|
||||
}
|
||||
}
|
||||
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
if (~llListFindList(admin,[(string) id]))
|
||||
{
|
||||
if (message == "Delete")
|
||||
{
|
||||
llDialog(id,"Are you sure?",["YES", "NO"],channel);
|
||||
return;
|
||||
}
|
||||
else if (message == "YES" )
|
||||
{
|
||||
message="Delete";
|
||||
}
|
||||
else if (message=="NO")
|
||||
return;
|
||||
|
||||
integer i;
|
||||
for (i = 0; i < llGetListLength(lMail); i += 2)
|
||||
{
|
||||
string cName = llList2String(lMail, i);
|
||||
integer nStatus = llList2Integer(lMail, i + 1);
|
||||
|
||||
if (message == "Unread" && nStatus == MAIL_UNREAD)
|
||||
{
|
||||
// open un-read, mark read
|
||||
llGiveInventory(id, cName);
|
||||
lMail = llListReplaceList(lMail, [MAIL_READ], i + 1, i + 1);
|
||||
}
|
||||
else if (message == "Read" && nStatus == MAIL_READ)
|
||||
{
|
||||
// open read
|
||||
llGiveInventory(id, cName);
|
||||
}
|
||||
else if (message == "Delete" && nStatus == MAIL_READ)
|
||||
{
|
||||
// delete read
|
||||
llRegionSayTo(id,0, "Deleting " + cName);
|
||||
llRemoveInventory(cName);
|
||||
lMail = llDeleteSubList(lMail, i, i+1);
|
||||
i=i-2; // list has become smaller (solves the bug in original version)
|
||||
}
|
||||
}
|
||||
|
||||
txtRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
// did the inventory not change due to owner or someone using drop access?
|
||||
if (! (change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) )
|
||||
return; // back off
|
||||
|
||||
if (llGetInventoryNumber(INVENTORY_ALL) < 2)
|
||||
{
|
||||
// clear the list
|
||||
lMail = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
scanInventory(TRUE);
|
||||
}
|
||||
|
||||
// refresh the text
|
||||
txtRefresh();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<Solution name="Single-Prim Multi-Drawer Script">
|
||||
<Project name="Single-Prim Multi-Drawer Script" path="Single-Prim Multi-Drawer Script\Single-Prim Multi-Drawer Script.prj" active="true"/>
|
||||
</Solution>
|
||||
@@ -0,0 +1,357 @@
|
||||
// :CATEGORY:Furniture
|
||||
// :NAME: Single-Prim Multi-Drawer Script
|
||||
// :AUTHOR:Sheena Desade
|
||||
// :KEYWORDS:
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:
|
||||
// Opensim drawers in a check
|
||||
// :CODE:
|
||||
|
||||
//list we're going to store our data in
|
||||
list l_drawer_prims;
|
||||
|
||||
//i_is_backwards is for if they put a negative sign in front of the offset, indicating
|
||||
//that they want it to open the opposite direction
|
||||
integer i_is_backwards = FALSE;
|
||||
//was the dresser set up properly?
|
||||
integer i_proper_config = TRUE;
|
||||
|
||||
//integer i_global;
|
||||
//which axis are they wanting to move it on?
|
||||
string s_axis = "y";
|
||||
//how much do they want it to move?
|
||||
float f_offset = -0.5;
|
||||
//how long should they hold the touch for until the script resets?
|
||||
float f_reset_touch_time = 2.0;
|
||||
//integer to tell if they held the touch
|
||||
integer i_touch_held = FALSE;
|
||||
|
||||
get_drawers()
|
||||
{
|
||||
integer i;
|
||||
integer i_length = llGetNumberOfPrims();
|
||||
for (i = 1;i <= i_length;i++)
|
||||
{
|
||||
string s_prim_name = llGetLinkName(i);
|
||||
vector v_root_position = llGetRootPosition();
|
||||
|
||||
if (s_prim_name == "drawer")
|
||||
{
|
||||
//Gets child prim's UUID
|
||||
key k_link_key = llGetLinkKey(i);
|
||||
//Gets child prim's regional position
|
||||
vector v_link_vector = llList2Vector(llGetObjectDetails(k_link_key, [OBJECT_POS]), 0);
|
||||
//Gets child prim's local position, corrected for rotation
|
||||
v_link_vector = (v_link_vector - v_root_position) / llGetRootRotation();
|
||||
//updates the list with all the details of the new drawer
|
||||
l_drawer_prims = (l_drawer_prims=[])+l_drawer_prims+(i)+v_link_vector+"closed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_config()
|
||||
{
|
||||
//Gets the object's description as a list, in all lower-case letters so we don't have to
|
||||
//worry about capitalizations later
|
||||
string s_desc = llToLower(llList2String(llGetPrimitiveParams([PRIM_DESC]), 0));
|
||||
//Seperates the variables and values in the object's description into a list,
|
||||
//discarding the seperators
|
||||
list s_desc2 = llParseString2List(s_desc, ["::", "="], [""]);
|
||||
//Used in initiating the for loop
|
||||
integer i;
|
||||
//Gets the number of entries in the list 'desc2'
|
||||
integer i_length = llGetListLength(s_desc2);
|
||||
//i starts at zero, and the for loop runs for as long as i is less than the length of the
|
||||
//list 'desc2.' at the end of every iteration, it increases i by two, bringing us to the next
|
||||
//set of variables and values
|
||||
for (i = 0;i < i_length; i = (i+2))
|
||||
{
|
||||
//result means the value of the variable, it will always be second
|
||||
string s_result = llStringTrim(llList2String(s_desc2, i+1), STRING_TRIM);
|
||||
//token means the variable name, it will allways be first
|
||||
string s_token = llStringTrim(llList2String(s_desc2, i), STRING_TRIM);
|
||||
|
||||
//--- Took this out because it would take too much server time to set values for
|
||||
//individual drawers, especially if there's a lot of them ---
|
||||
//--- (Also, I'm lazy... maybe in a future version) ---
|
||||
//if(token == "configuration")
|
||||
//{
|
||||
//if(result == "global") i_global = TRUE;
|
||||
//else if(result == "individual") i_global = FALSE;
|
||||
//else
|
||||
//{
|
||||
//llOwnerSay("Oops! configuration must be set to 'global' or 'individual.'");
|
||||
//i_proper_config = FALSE;
|
||||
//}
|
||||
//}
|
||||
|
||||
//If we're storing the value for the 'axis' variable
|
||||
if(s_token == "axis")
|
||||
{
|
||||
//if the value for 'axis' is 'x,' 'y,' or 'z'
|
||||
if(s_result == "x" || s_result == "y" || s_result == "z") s_axis = s_result;
|
||||
|
||||
//if not, they put an incorrect value in
|
||||
else
|
||||
{
|
||||
llOwnerSay("Oops! axis must be set to 'x,' y,' or 'z.'");
|
||||
//it's not going to run correctly, so let's stop them from using it
|
||||
i_proper_config = FALSE;
|
||||
//let's reset the touch time to something really low, so it's easy to
|
||||
//reset
|
||||
f_reset_touch_time = 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
//if we're storing the value for the 'offset' variable
|
||||
else if(s_token == "offset")
|
||||
{
|
||||
//temporary variable used later to check for a '-' symbol
|
||||
string s_offset = llList2String(s_desc2, i+1);
|
||||
//another temporary variable used to see if they put a '+' symbol (which isn't
|
||||
//allowed) in there.
|
||||
integer i4 = llSubStringIndex(s_offset, "+");
|
||||
//going ahead and setting the float as a float, to check and see if they
|
||||
//decided to put letters or symbols in it
|
||||
f_offset = llList2Float(s_desc2, i+1);
|
||||
//if they did put letters or symbols in it
|
||||
if(f_offset == 0.000000 || i4 != -1)
|
||||
{
|
||||
llOwnerSay("Oops! The offset value must be other than 0.000000 "
|
||||
+ "and must not contain any letters or special characters aside from a properly "
|
||||
+ "placed negative (-) symbol to indicate a reversed direction from the norm.");
|
||||
//it's not going to run correctly, so let's stop them from using it
|
||||
i_proper_config = FALSE;
|
||||
//let's reset the touch time to something really low, so it's easy to
|
||||
//reset
|
||||
f_reset_touch_time = 0.1;
|
||||
}
|
||||
|
||||
//passed the symbol check, on to the next thing
|
||||
else
|
||||
{
|
||||
//i3 is used to see if there is a '-' symbol, along with the string version
|
||||
//of the float, which we saved earlier
|
||||
integer i3 = llSubStringIndex(s_offset, "-");
|
||||
//yep, there's a '-' symbol...
|
||||
if (i3 != -1)
|
||||
{
|
||||
//but it isn't at the beginning, where it's supposed to be.
|
||||
if(i3 != 1)
|
||||
{
|
||||
llOwnerSay("Oops! the negative symbol (-) can only be placed at the "
|
||||
+ "beginning of the float.");
|
||||
//it's not going to run correctly, so let's stop them from using it
|
||||
i_proper_config = FALSE;
|
||||
//let's reset the touch time to something really low, so it's easy to
|
||||
//reset
|
||||
f_reset_touch_time = 0.1;
|
||||
}
|
||||
|
||||
//and the '-' symbol is at the beginning, where it's supposed to be.
|
||||
else
|
||||
{
|
||||
//gotta get rid of that pesky '-' symbol so it doesn't interfere with
|
||||
//our math later.
|
||||
s_offset = llDeleteSubString(s_offset, 0, i3);
|
||||
//okie dokie, got rid of it, now let's save the value for offset
|
||||
f_offset = (float)s_offset;
|
||||
//this is how we know there was originally a '-' symbol there
|
||||
i_is_backwards = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
//can't move a prim more than ten meters, so let's reset it to ten if it's more
|
||||
if(f_offset > 10.00) f_offset = 10.00;
|
||||
}
|
||||
}
|
||||
|
||||
//if we're storing the value for the 'touch time to reset' variable
|
||||
else if(s_token == "touch time to reset")
|
||||
{
|
||||
//gotta look for that '-' symbol again, this float isn't supposed to have it
|
||||
integer i3 = llSubStringIndex(llList2String(s_desc2, i+1), "-");
|
||||
//also gotta check if they put letters or other symbols in there. If not, we're good
|
||||
//to go
|
||||
f_reset_touch_time = llList2Float(s_desc2, i+1);
|
||||
|
||||
//uh-oh, they put letters or symbols in there
|
||||
if(f_reset_touch_time == 0.000000 || i3 != -1)
|
||||
{
|
||||
llOwnerSay("Oops! The touch time to reset must be greater than 0.000000 "+
|
||||
"and must not contain any letters or special characters.");
|
||||
//it's not going to run correctly, so let's stop them from using it
|
||||
i_proper_config = FALSE;
|
||||
//let's reset the touch time to something really low, so it's easy to
|
||||
//reset
|
||||
f_reset_touch_time = 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Let's leave this here for debugging purposes, but commented out
|
||||
/*llSay(0, "After For: axis is set to " + s_axis + "; offset is set to "
|
||||
+ (string) f_offset + "; i_is_backwards is set to " + (string)i_is_backwards
|
||||
+ "; i_proper_config is set to " + (string)i_proper_config + "; touch time to reset "
|
||||
+ "is set to: " +(string)f_reset_touch_time);*/
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
on_rez(integer start_param)
|
||||
{
|
||||
//we need to reset the script if it's just being rezzed.
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
state_entry()
|
||||
{
|
||||
llOwnerSay("Initializing drawer script...");
|
||||
//we don't want anyone to sit on this, so we'll set a sit target we can use later
|
||||
//to unsit the avatar so our dresser doesn't break
|
||||
llSitTarget(<0, 0, 0.1>, ZERO_ROTATION);
|
||||
//let's get the drawer list and positions as soon as we start up or reset
|
||||
get_drawers();
|
||||
//okay, now we have to get the configuration set-up
|
||||
get_config();
|
||||
if(!i_proper_config) llOwnerSay("...I seem to be configured incorrectly. Please fix "
|
||||
+ "me using the above error message or read the help card, then reset me by clicking me "
|
||||
+ "and holding for " + (string)f_reset_touch_time + " seconds.");
|
||||
else if (i_proper_config) llOwnerSay("...done.");
|
||||
}
|
||||
|
||||
//whenever they touch it
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
//Debugging purposes
|
||||
//llSay(0, "Link numbers with the name 'drawer': " + llDumpList2String(l_drawer_prims, ", "));
|
||||
//this is where the timer for the reset goes.
|
||||
if(llDetectedLinkNumber(0) == 1 && llDetectedKey(0) == llGetOwner())
|
||||
{ llSetTimerEvent(f_reset_touch_time); }
|
||||
//get the link number
|
||||
integer i_dln = llDetectedLinkNumber(0);
|
||||
//now we're going to actually check our drawer list and see if the prim's in there
|
||||
integer i_test = llListFindList(l_drawer_prims, [i_dln]);
|
||||
|
||||
if (!i_proper_config && llDetectedKey(0) != llGetOwner()) llRegionSayTo(llDetectedKey(0), 0, "Sorry, but I wasn't "
|
||||
+ "configured properly, so I don't quite know where to move my bits and pieces to. "
|
||||
+ "Please talk to my owner," + llKey2Name(llGetOwner()) + " about this.");
|
||||
|
||||
//if it's in the list AND the drawers are configured properly
|
||||
else if(i_test != -1 && i_proper_config)
|
||||
{
|
||||
//is the drawer opened or closed?
|
||||
string s_drawer_status = llList2String(l_drawer_prims, i_test+2);
|
||||
|
||||
//if the drawer's closed
|
||||
if(s_drawer_status == "closed")
|
||||
{
|
||||
//we're going to make a temporary offset float so we don't overwrite
|
||||
//the original
|
||||
float f_temp_offset = f_offset;
|
||||
|
||||
//if they used a negative float for the offset
|
||||
if(i_is_backwards) f_temp_offset = (0.0-f_temp_offset);
|
||||
//if they used a positive float for the offset
|
||||
else f_temp_offset = f_offset;
|
||||
|
||||
//if they want it moved on the x axis
|
||||
if(s_axis == "x")
|
||||
{
|
||||
//let's retrieve the position info from our handy-dandy list
|
||||
vector v_link_position = llList2Vector(l_drawer_prims, i_test+1);
|
||||
//now we need to update the x value of the drawer's position
|
||||
//to reflect the offset they want
|
||||
v_link_position.x = v_link_position.x+f_temp_offset;
|
||||
//and finally we move it
|
||||
llSetLinkPrimitiveParamsFast(i_dln, [PRIM_POSITION, v_link_position]);
|
||||
}
|
||||
|
||||
//if they want it moved on the x axis
|
||||
else if(s_axis == "y")
|
||||
{
|
||||
//let's retrieve the position info from our handy-dandy list
|
||||
vector v_link_position = llList2Vector(l_drawer_prims, i_test+1);
|
||||
//now we need to update the y value of the drawer's position
|
||||
//to reflect the offset they want
|
||||
v_link_position.y = v_link_position.y+f_temp_offset;
|
||||
//and finally we move it
|
||||
llSetLinkPrimitiveParamsFast(i_dln, [PRIM_POSITION, v_link_position]);
|
||||
}
|
||||
|
||||
else if(s_axis == "z")
|
||||
{
|
||||
//let's retrieve the position info from our handy-dandy list
|
||||
vector v_link_position = llList2Vector(l_drawer_prims, i_test+1); //now we need to update the y value of the drawer's position
|
||||
//to reflect the offset they want
|
||||
v_link_position.z = v_link_position.z+f_temp_offset;
|
||||
//and finally we move it
|
||||
llSetLinkPrimitiveParamsFast(i_dln, [PRIM_POSITION, v_link_position]);
|
||||
|
||||
}
|
||||
|
||||
//last in this section, we update the list to reflect our shiny new 'open' status
|
||||
l_drawer_prims = llListReplaceList(l_drawer_prims, ["open"], i_test+2, i_test+2);
|
||||
}
|
||||
|
||||
//if the drawer is open
|
||||
else if(s_drawer_status == "open")
|
||||
{
|
||||
//let's retrieve what the drawer's position is supposed to be
|
||||
vector v_link_position = llList2Vector(l_drawer_prims, i_test+1);
|
||||
//let's move the drawer back to where it belongs
|
||||
llSetLinkPrimitiveParamsFast(i_dln, [PRIM_POSITION, v_link_position]);
|
||||
//then let's update the status of our drawer
|
||||
l_drawer_prims = llListReplaceList(l_drawer_prims, ["closed"], i_test+2, i_test+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//When the person releases the mouse from touching the object
|
||||
touch_end(integer num_detected)
|
||||
{
|
||||
//make it so we don't have a timer event any more (saves on memory in the long run)
|
||||
//(of course, we're about to reset the script, so it doesn't really matter, but
|
||||
//it never hurts to get in good practice)
|
||||
llSetTimerEvent(0.0);
|
||||
|
||||
//if they held the touch for the entire reset script touch time
|
||||
if (i_touch_held == TRUE) llResetScript();
|
||||
}
|
||||
|
||||
timer()
|
||||
{
|
||||
//lets them know that they can release their hold now
|
||||
llOwnerSay("Release me to reset the script.");
|
||||
//sets the touch held integer to true so the script will reset on touch end
|
||||
i_touch_held = TRUE;
|
||||
//again, good practice to reset the timer, even if we won't be using it
|
||||
llSetTimerEvent(0.0);
|
||||
}
|
||||
|
||||
//if the person has changed the object
|
||||
changed(integer change)
|
||||
{
|
||||
//if the person has linked or de-linked the object, or if an avatar has sat on the object
|
||||
if(change & CHANGED_LINK)
|
||||
{
|
||||
//originally added to give the server time to adjust to someone sitting on this
|
||||
llSleep(0.5);
|
||||
//gets the avatar key from the SitTarget function used earlier...
|
||||
key k_avatar_key = llAvatarOnSitTarget();
|
||||
//...if an avatar is sitting on it, then we unsit him. Bad av!
|
||||
if (k_avatar_key) llUnSit(k_avatar_key);
|
||||
else
|
||||
{
|
||||
llOwnerSay("Remapping drawers...");
|
||||
get_drawers();
|
||||
llOwnerSay("Re-evaluating configuration...");
|
||||
if (i_proper_config) llOwnerSay("...done.");
|
||||
else llOwnerSay("...I seem to be configured incorrectly. Please fix "
|
||||
+ "me using the above error message or read the help card, then reset me by clicking me "
|
||||
+ "and holding for " + (string)f_reset_touch_time + " seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<Project name="Single-Prim Multi-Drawer Script" guid="f1671031-768a-415a-be02-02aa98d508d7">
|
||||
<Object name="Drawer" guid="460fa189-732d-42b0-96e3-b2dd639e16f1" active="true">
|
||||
<Script name="Script.lsl" guid="2b2e62c6-8874-4385-8f1e-7c3b1bfa088a">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
3
Soul Finder/Soul Finder.sol
Normal file
3
Soul Finder/Soul Finder.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Soul Finder">
|
||||
<Project name="Soul Finder" path="Soul Finder\Soul Finder.prj" active="true"/>
|
||||
</Solution>
|
||||
6
Soul Finder/Soul Finder/Soul Finder.prj
Normal file
6
Soul Finder/Soul Finder/Soul Finder.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="Soul Finder" guid="d6321acb-aaf6-4ac2-ab0f-041e4f9a6cce">
|
||||
<Object name="Wear this Prim" guid="5c874dcc-413a-491d-921b-5982516dada3" active="true">
|
||||
<Script name="Script.lsl" guid="5766b7ae-094d-4e27-adf2-56336fd1ca9c">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
105
Soul Finder/Soul Finder/Wear this Prim/Script.lsl
Normal file
105
Soul Finder/Soul Finder/Wear this Prim/Script.lsl
Normal file
@@ -0,0 +1,105 @@
|
||||
// :CATEGORY:Sensor
|
||||
// :NAME:Soul Finder
|
||||
// :AUTHOR:CyberGlo CyberStar
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, Opensim
|
||||
// :DESCRIPTION:
|
||||
// it will point a stream of particles toward any persons location
|
||||
// :CODE:
|
||||
//CyberGlo CyberStar
|
||||
//Soul Finder
|
||||
// put this script in a small prim and wear it.
|
||||
// type on channel 7 on
|
||||
// like this /7 on
|
||||
// type /7 nameofavatar
|
||||
// it will point a stream of particles toward this persons location
|
||||
// no matter where they are on the sim.
|
||||
// even if they walk around it will follow them
|
||||
// this makes it easy to find people in crowded sims, even if you cant rez an object or tp to them.
|
||||
// email: pctek.cyberstar@gmail.com
|
||||
|
||||
string gStrAgentName;
|
||||
key gStrAgentId;
|
||||
|
||||
integer listenHandle;
|
||||
|
||||
remove_listen_handle()
|
||||
{
|
||||
llListenRemove(listenHandle);
|
||||
}
|
||||
|
||||
updateParticles(key target)
|
||||
{
|
||||
|
||||
llParticleSystem([
|
||||
PSYS_PART_FLAGS, 0 | PSYS_PART_EMISSIVE_MASK |
|
||||
PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK |
|
||||
PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK |PSYS_PART_TARGET_POS_MASK ,
|
||||
PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_EXPLODE,
|
||||
PSYS_PART_MAX_AGE, 2.0,
|
||||
PSYS_PART_START_COLOR,<1,0,0>,
|
||||
PSYS_PART_END_COLOR,<1,0,0>,
|
||||
PSYS_PART_START_SCALE,<0.3, 0.8, 0.3>,
|
||||
PSYS_PART_END_SCALE,<0.1, 0.2, 0.1>,
|
||||
PSYS_PART_START_GLOW, 1.0,
|
||||
PSYS_SRC_BURST_RATE,0.01,
|
||||
PSYS_SRC_ACCEL,<0.0, 0.0, 0.0>,
|
||||
PSYS_SRC_BURST_PART_COUNT,3,
|
||||
PSYS_SRC_BURST_RADIUS,0.10,
|
||||
PSYS_SRC_BURST_SPEED_MIN,0.10,
|
||||
PSYS_SRC_BURST_SPEED_MAX,0.50,
|
||||
PSYS_SRC_TARGET_KEY,target,
|
||||
PSYS_SRC_INNERANGLE,1.55,
|
||||
PSYS_SRC_OUTERANGLE,1.54,
|
||||
PSYS_SRC_OMEGA,<0.0, 0.0, 5.0>,
|
||||
PSYS_SRC_MAX_AGE,0.00,
|
||||
PSYS_PART_START_ALPHA,0.50,
|
||||
PSYS_PART_END_ALPHA,0.10
|
||||
]);
|
||||
|
||||
}
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
|
||||
listenHandle = llListen(7, "", llGetOwner(), "");
|
||||
}
|
||||
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
gStrAgentName = message;
|
||||
if ( message == "off" )
|
||||
{
|
||||
llParticleSystem([]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gStrAgentId = llName2Key(gStrAgentName);
|
||||
if(llGetAgentSize(gStrAgentId))
|
||||
{
|
||||
vector pos = llList2Vector(llGetObjectDetails(gStrAgentId, [OBJECT_POS]), 0);
|
||||
llOwnerSay("I found: " + gStrAgentName + " at " + (string)pos);
|
||||
updateParticles(gStrAgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("The person named: " + gStrAgentName + " isn't in this Land.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
on_rez(integer start_param)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_OWNER)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user