New Stuff

This commit is contained in:
Fred Beckhusen
2020-09-29 12:27:50 -05:00
parent 9bf2d6a1c4
commit 68a6f7f2cb
13 changed files with 912 additions and 10 deletions

View File

@@ -0,0 +1,3 @@
<Solution name="Dreamgrid Auto teleport sign">
<Project name="Dreamgrid Auto teleport sign" path="Dreamgrid Auto teleport sign\Dreamgrid Auto teleport sign.prj" active="true"/>
</Solution>

View File

@@ -0,0 +1,6 @@
<Project name="Dreamgrid Auto teleport sign" guid="78fbc5b8-f4be-4131-9a4d-7eefe82f0009">
<Object name="Object" guid="bece8098-892b-495c-b9b0-4f8f7f0b6bd2" active="true">
<Script name="Script.lsl" guid="362c5e38-78ee-4474-aa51-3dae947f8732">
</Script>
</Object>
</Project>

View File

@@ -0,0 +1,450 @@
// (c) The owner of Avatar Jeff Kelley, 2010
//
// This script is licensed under Creative Commons BY-NC-SA
// See <http://creativecommons.org/licenses/by-nc-sa/3.0/>
//
// You may not use this work for commercial purposes.
// You must attribute the work to the author, Jeff Kelley.
// You may distribute, alter, transform, or build upon this work
// as long as you do not delete the name of the original author.
//
// *** UPDATED ***
// Mods to Fit Dreamgrid methods Fred Beckhusen 9/7/2018
// Mods to allow more than one sign Fred Beckhusen 6/9/2019 - just add the sign number in the Description - 0,1,2,3,4 etc.
//INSTRUCTIONS
// Change the Description from 0, to 1,2,3 for each sign
//
key httpQueryId;
string localGrid;
float TIMER = 7200; // refresh in seconds
integer DEBUG_ON = FALSE;
DEBUG(string message) {if (DEBUG_ON) llOwnerSay(message);}
string datasource ;
string strReplace(string str, string search, string replace) {
return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace);
}
integer isUUID (string s) {
list parse = llParseString2List (s, ["-"],[]);
return ((llStringLength (llList2String (parse, 0)) == 8)
&& (llStringLength (llList2String (parse, 1)) == 4)
&& (llStringLength (llList2String (parse, 2)) == 4)
&& (llStringLength (llList2String (parse, 3)) == 4)
&& (llStringLength (llList2String (parse, 4)) == 12));
}
///////////////////
// Http stuff
///////////////////
sendHTTPRequest (string url) {
httpQueryId = llHTTPRequest(url,[HTTP_BODY_MAXLENGTH,16384],"");
//[ HTTP_METHOD, "GET", HTTP_MIMETYPE,"text/plain;charset=utf-8" ], "");
// [ HTTP_METHOD, "GET", HTTP_MIMETYPE,"text/plain" ], "");
}
string URI2hostport (string uri) {
list parse = llParseString2List (uri, [":"], []);
return llList2String (parse, 0)
+":" + llList2String (parse, 1);
}
///////////////////////////////////////////////////////////////////
// Part 2 : Parsing & accessors
///////////////////////////////////////////////////////////////////
list destinations; // Strided list for destinations
integer NAME_IDX = 0; // Index of region name in list
integer COOR_IDX = 1; // Index of grid coordinates in list
integer HURL_IDX = 2; // Index of hypergrid url in list
integer HGOK_IDX = 3; // Index of validity flag in list
integer LAND_IDX = 4; // Index of landing point in list
integer N_FIELDS = 5; // Total number of fields
parseFile (string data) {
integer signNumber = (integer) llGetObjectDesc();
// Should be 0,1,2, etc
destinations = [];
list lines = llParseString2List (data,["\n"],[]);
integer nl = llGetListLength (lines);
DEBUG("length = " + (string) nl);
integer last = nl + ( signNumber * 32 );
DEBUG("last = "+ (string) last);
integer i; for (i=0;i<last;i++) {
integer n = (signNumber * 32) + i;
DEBUG ("Parse line " + (string) n);
parseLine (llList2String(lines,n));
}
}
parseLine (string line) {
if (line == "") return; // Ignore empty lines
if (llGetSubString (line,0,1) == "//") { // Is this a comment?
llOwnerSay ("(Comment) "+line);
return;
}
list parse = llParseStringKeepNulls (line, ["|"],[]);
string grid = llList2String (parse, 0); // Grid name
string name = llList2String (parse, 1); // Region name
string gloc = llList2String (parse, 2); // Coordinates
string hurl = llList2String (parse, 3); // HG url
string coor = llList2String (parse, 4); // Landing
// Parse and check grid location
// *** CHANGED by Aine Caoimhe: removed distance check because 0.8.0 and later no longer have distance limit
// parse = llParseString2List (gloc, [","],[]);
// integer xloc = llList2Integer (parse, 0); // X grid location
// integer yloc = llList2Integer (parse, 1); // Y grid location
// vector hisLoc = <xloc, yloc, 0>;
// vector ourLoc = llGetRegionCorner()/256;
// integer ok =( llAbs(llFloor(hisLoc.x - ourLoc.x)) < 4096 )
// && ( llAbs(llFloor(hisLoc.y - ourLoc.y)) < 4096 )
// && ( hisLoc != ourLoc);
integer ok=TRUE;
// *** END CHANGE
// Parse and check landing point
parse = llParseString2List (coor, [","],[]);
integer xland = llList2Integer (parse, 0); // X landing point
integer yland = llList2Integer (parse, 1); // Y landing point
integer zland = llList2Integer (parse, 2); // Z landing point
vector land = <xland, yland, zland>;
if (land == ZERO_VECTOR) land = <128,128,20>;
// Note: grid and region names merged into one field
destinations += [grid+" "+name, gloc, hurl, ok, land];
}
///////////////////
// List accessors
///////////////////
string dst_name (integer n) { // Get name for destination n
return llList2String (destinations, N_FIELDS*n +NAME_IDX);
}
string dst_coord (integer n) { // Get coords for destination n
return llList2String (destinations, N_FIELDS*n +COOR_IDX);
}
vector dst_landp (integer n) { // Get landing point for destination n
return llList2Vector (destinations, N_FIELDS*n +LAND_IDX);
}
string dst_hgurl (integer n) { // Get hypergrid url for destination n
return llList2String (destinations, N_FIELDS*n +HURL_IDX);
}
integer dst_valid (integer n) { // Get validity flag for destination n
return llList2Integer (destinations, N_FIELDS*n +HGOK_IDX);
}
////////////////////////////////////////////////////////////
// Part 3 : Drawing
////////////////////////////////////////////////////////////
integer TEXTURE_SIZE = 512;
integer DISPLAY_SIDE = 4;
integer FONT_SIZE = 10; // Depends on TEXTURE_SIZE
integer COLUMNS = 2;
integer ROWS = 16;
string validCellColor = "CadetBlue";
// string invalCellColor = "IndianRed";
string invalCellColor = "CadetBlue";
string emptyCellColor = "DarkGray";
string cellBorderColor = "White";
string backgroundColor = "Gray";
string drawList;
displayBegin() {
drawList = "";
}
displayEnd() {
osSetDynamicTextureData ( "", "vector", drawList,
"width:"+(string)TEXTURE_SIZE+",height:"+(string)TEXTURE_SIZE, 0);
}
drawCell (integer x, integer y) {
integer CELL_HEIGHT = TEXTURE_SIZE / ROWS;
integer CELL_WIDHT = TEXTURE_SIZE / COLUMNS;
integer xTopLeft = x*CELL_WIDHT;
integer yTopLeft = y*CELL_HEIGHT;
// Draw grid
drawList = osSetPenColor (drawList, cellBorderColor);
drawList = osMovePen (drawList, xTopLeft, yTopLeft);
drawList = osDrawRectangle (drawList, CELL_WIDHT, CELL_HEIGHT);
integer index = (y+x*ROWS);
string cellName = dst_name(index);
integer cellValid = dst_valid(index);
string cellBbackground;
if (cellName == "") cellBbackground = emptyCellColor; else
if (cellValid) cellBbackground = validCellColor; else
cellBbackground = invalCellColor;
// Fill background
drawList = osSetPenColor (drawList, cellBbackground);
drawList = osMovePen (drawList, xTopLeft+2, yTopLeft+2);
drawList = osDrawFilledRectangle (drawList, CELL_WIDHT-3, CELL_HEIGHT-3);
xTopLeft += 2; // Center text in cell
yTopLeft += 6; // Center text in cell
drawList = osSetPenColor (drawList, "Black");
drawList = osMovePen (drawList, xTopLeft, yTopLeft);
drawList = osDrawText (drawList, cellName);
}
drawTable() {
displayBegin();
drawList = osSetPenSize (drawList, 1);
drawList = osSetFontSize (drawList, FONT_SIZE);
drawList = osMovePen (drawList, 0, 0);
drawList = osSetPenColor (drawList, backgroundColor);
drawList = osDrawFilledRectangle (drawList, TEXTURE_SIZE, TEXTURE_SIZE);
integer x; integer y;
for (x=0; x<COLUMNS; x++)
for (y=0; y<ROWS; y++)
drawCell (x, y);
displayEnd();
}
integer getCellClicked(vector point) {
integer y = (ROWS-1) - llFloor(point.y*ROWS); // Top to bottom
integer x = llFloor(point.x*COLUMNS); // Left to right
integer index = (y+x*ROWS);
return index;
}
///////////////////////////////////////////////////////////////////
// Part 4 : Action routines: when clicked, when http test succeed
///////////////////////////////////////////////////////////////////
string CLICK_SOUND = "clickSound"; // Sound to play when board clicked
string TELPT_SOUND = "teleportSound"; // Sound to play when teleported
integer JUMP_DELAY = 2; // Time to wait before teleport
string hippo_url; // URL for http check
string telep_url; // For osTeleportAgent
key telep_key; // For osTeleportAgent
vector telep_land; // For osTeleportAgent
integer action (integer index, key who) {
DEBUG("Index:" + (string) index);
string name = dst_name (index);
string gloc = dst_coord (index);
vector land = dst_landp (index);
string hurl = dst_hgurl (index);
integer ok = dst_valid (index);
if (name == "") return FALSE; // Empty cell
if (hurl == "") return FALSE; // Empty cell
// if (!ok) llWhisper (0, "This region is too far ("+gloc+")");
// if (!ok) return FALSE; // Incompatible region
llWhisper (0, "You have selected "+name+", location "+gloc);
// Pr<50>parer les globales avant de sauter
telep_key = who; // Pass to postaction
telep_url = hurl; // Pass to postaction
telep_land = land; // Pass to postaction
hippo_url = "http://"+URI2hostport(hurl); // Pass to http check
DEBUG ("Region name: " +name +" "+gloc+" (Check="+(string)ok+")");
DEBUG ("Landing point: " +(string)land);
DEBUG ("Hypergrid Url: " +hurl);
DEBUG ("Hippochek url: " +hippo_url);
llTriggerSound (CLICK_SOUND, 1.0);
return TRUE;
}
postaction (integer success) {
if (success) {
llWhisper (0, "Fasten your seat belt, we move!!!");
llPlaySound (TELPT_SOUND, 1.0); llSleep (JUMP_DELAY);
// CHANGED by Aine Caoimhe: if local grid, strip that from the telep_url before sending
DEBUG("Grid:" + localGrid);
if (llSubStringIndex(telep_url,localGrid)==0 )
{
telep_url=llGetSubString(telep_url,llStringLength(localGrid)+1,-1);
DEBUG ("This is a local TP so stripped grid portion of URL. New telep_url is: "+telep_url);
}
DEBUG("Url :[" + telep_url + "]");
DEBUG("Land:" + (string) telep_land);
osTeleportAgent(telep_key, telep_url, telep_land, ZERO_VECTOR);
} else {
llWhisper (0, "Sorry, host is not available");
}
}
key kOutworldzKey;
///////////////////////////////////////////////////////////////////
// State 1 : read the data and draw the board
///////////////////////////////////////////////////////////////////
default {
on_rez(integer p) {
llResetScript();
}
state_entry() {
llRemoveInventory("HGBoard v1.0");
datasource = osGetGridGatekeeperURI() + "/bin/data/teleports.htm";
localGrid = osGetGridGatekeeperURI();
DEBUG(datasource);
kOutworldzKey = llHTTPRequest(datasource,[HTTP_BODY_MAXLENGTH,16384],"");
}
// Handler fot http:// datasource
http_response(key id,integer status, list meta, string body) {
DEBUG(body);
if ( id == kOutworldzKey) {
parseFile (body);
drawTable();
state ready;
}
}
changed(integer what) {
if (what & CHANGED_REGION) llResetScript();
if (what & CHANGED_INVENTORY) llResetScript();
if (what & CHANGED_REGION_START) llResetScript();
}
}
///////////////////////////////////////////////////////////////////
// State 2 : running, we pass most of our time here
///////////////////////////////////////////////////////////////////
state ready {
state_entry() {
llSetTimerEvent(TIMER);
}
timer() {
DEBUG("Reset");
state default;
}
on_rez(integer p) {
llResetScript();
}
touch_start (integer n) {
key whoClick = llDetectedKey(0);
vector point = llDetectedTouchST(0);
integer face = llDetectedTouchFace(0);
integer link = llDetectedLinkNumber(0);
DEBUG("Face = " + face);
if (link != LINK_ROOT)
if (whoClick == llGetOwner()) llResetScript();
else return;
if (point == TOUCH_INVALID_TEXCOORD) return;
if (face != DISPLAY_SIDE) return;
integer ok = action (getCellClicked(point), whoClick);
if (!ok) return; // Incompatible grid coordinates
// Proceed to http check which
// will chain to osTeleportAgent
llWhisper (0, "Checking host. This may take up to 30s, please wait...");
state hippos; // Perform HTTP check
}
changed(integer what) {
if (what & CHANGED_REGION) llResetScript();
if (what & CHANGED_INVENTORY) llResetScript();
if (what & CHANGED_REGION_START) llResetScript();
}
}
///////////////////////////////////////////////////////////////////
// State 3 : HTTP host check
///////////////////////////////////////////////////////////////////
state hippos {
on_rez(integer p) {
llResetScript();
}
state_entry() {
DEBUG(hippo_url);
sendHTTPRequest (hippo_url);
llSetTimerEvent (60);
}
http_response(key id,integer status, list meta, string body) {
if (id == httpQueryId)
postaction (status == 200);
state ready;
}
timer() {
llSetTimerEvent (0);
postaction (FALSE);
state ready;
}
changed(integer what) {
if (what & CHANGED_REGION) llResetScript();
if (what & CHANGED_INVENTORY) llResetScript();
if (what & CHANGED_REGION_START) llResetScript();
}
}

View File

@@ -0,0 +1,60 @@
//
// Give with notice via HTTP
//
// Fill in your server and port, if necessary, port 80 is a default. It will connect to Apache with the parameter ?name=(Prim Name)
string SERVER = "http://outworldz.com";
// * This function cases the script to sleep for 3.0 seconds.
// * If inventory is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
// * Avatar must be, or have recently been, within the same Region as sending object.
// * Does not create a folder when avatar is a prim UUID.
// o The prim must be in the same region.
//Examples
// When a user clicks this object, this script will give a folder containing everything in the objects inventory
// This can serve as a unpacker script for boxed objects
default {
http_request(key id, string method, string body)
{
llOwnerSay("Someone just got " + llGetObjectName());
}
touch_start(integer total_number) {
llHTTPRequest(SERVER + "?Name=" + llGetObjectName(),[], "");
list inventory;
string name;
integer num = llGetInventoryNumber(INVENTORY_ALL);
integer i;
for (i = 0; i < num; ++i) {
name = llGetInventoryName(INVENTORY_ALL, i);
if(llGetInventoryPermMask(name, MASK_NEXT) & PERM_COPY)
inventory += name;
else
llSay(0, "Don't have permissions to give you \""+name+"\".");
}
//we don't want to give them this script
i = llListFindList(inventory, [llGetScriptName()]);
inventory = llDeleteSubList(inventory, i, i);
if (llGetListLength(inventory) < 1) {
llSay(0, "No items to offer.");
} else {
// give folder to agent, use name of object as name of folder we are giving
llGiveInventoryList(llDetectedKey(0), llGetObjectName(), inventory);
llHTTPRequest(SERVER,[],llGetObjectName());
}
}
}

View File

@@ -0,0 +1,95 @@
default {
state_entry() {
llParticleSystem( [
PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
PSYS_PART_START_SCALE, <15.5,15.5, 0>, PSYS_PART_END_SCALE, <0,2.0, 0>,
PSYS_PART_START_COLOR, <.2,0,.2>, PSYS_PART_END_COLOR, <.5,1,1>,
PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_ALPHA, 0.0,
PSYS_SRC_BURST_PART_COUNT, 1,
PSYS_SRC_BURST_RATE, 0.01,
PSYS_PART_MAX_AGE, 3.4,
PSYS_SRC_MAX_AGE, 0.0,
PSYS_SRC_PATTERN, 8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
// PSYS_SRC_BURST_RADIUS, 0.0,
PSYS_SRC_BURST_SPEED_MIN, .01, PSYS_SRC_BURST_SPEED_MAX, 3.01,
PSYS_SRC_ANGLE_BEGIN, 1*DEG_TO_RAD, PSYS_SRC_ANGLE_END, 0*DEG_TO_RAD,
PSYS_SRC_OMEGA, <0,0,0>,
// PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1),
PSYS_PART_FLAGS, ( 0
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// | PSYS_PART_TARGET_POS_MASK
// | PSYS_PART_TARGET_LINEAR_MASK
) ] );
}
}
// (particle appearance settings)
// TEXTURE, can be an "Asset UUID" key copied from a modable texture, or the name of a texture in the prim's inventory.
// SCALE, vector's x and y can be 0.0 to 4.0. z is ignored. Values smaller than 0.04 might not get rendered.
// END_SCALE requires the INTERP_SCALE_MASK
// COLOR, red,green,blue values from 0,0,0(black) to 1,1,1 (white)
// ALPHA, 0.0 = invisible, less than 0.1 may not get seen, 1.0 = solid/opaque
// END_COLOR and END_ALPHA both require INTERP_COLOR_MASK
// (emitter controls)
// BURST_PART_COUNT 1 to 4096
// BURST_RATE 0.0 to 60.0? # of seconds between bursts, smaller = faster
// PART_MAX_AGE, 0.0 to 30.0, particle lifespan in seconds
// SRC_MAX_AGE - emitter auto-off interval 0.0 never times out. 1.0 to 60.0.
// (placement and movement settings)
// PATTERN,
// DROP, no initial velocity, direction or distance from emitter
// EXPLODE, spray in all directions
// ANGLE, "fan" shape defined by ANGLE BEGIN and END values
// ANGLE_CONE, "ring" or "cone" shapes defined by ANGLE BEGIN and END values
// ACCEL, x,y,z 0.0 to 50.0? sets a constant force, (affects all patterns)
// RADIUS 0.0 to 50.0? distance from emitter to create new particles
// (Useless with DROP pattern and FOLLOW_SRC option)
// SPEED, 0.01 to 50.0? Sets range of starting velocities. (Useless with DROP pattern.)
// ANGLE_BEGIN & END, 0.0 (up) to PI (down), (Only useful with ANGLE patterns)
// OMEGA, x,y,z 0.0 to PI? Sets distance to rotate emitter nozzle between bursts
// (Only useful with ANGLE patterns)
// TARGET_KEY, "key", (requires a TARGET option below) can be many things :
// llGetOwner()
// llGetKey() target self
// llGetLinkKey(1) target parent prim
// llGetLinkKey(llGetLinkNum() + 1) target next prim in link set
// (on/off options that affect how particles look)
// EMISSIVE identical to "full bright" setting on prims
// FOLLOW_VELOCITY particle texture 'tilts' towards the direction it's moving
// INTERP_COLOR causes color and alpha to change over time
// INTERP_SCALE causes particle size to change over time
// (on/off options that affect how particles move)
// BOUNCE particles can't go below altitude of emitter
// WIND sim's wind will push particles around
// FOLLOW_SRC makes particles move (but not rotate) if their emitter moves, (disables RADIUS)
// TARGET_POS causes particles to home in on a target object
// TARGET_LINEAR forces a DROP pattern like behavior and disables wind.

View File

@@ -0,0 +1,95 @@
default {
state_entry() {
llParticleSystem( [
PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
PSYS_PART_START_SCALE, <15.5,15.5, 0>, PSYS_PART_END_SCALE, <0,2.0, 0>,
PSYS_PART_START_COLOR, <255,140,0>, PSYS_PART_END_COLOR, <.5,.2,0>,
PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_ALPHA, 0.0,
PSYS_SRC_BURST_PART_COUNT, 1,
PSYS_SRC_BURST_RATE, 0.01,
PSYS_PART_MAX_AGE, 3.4,
PSYS_SRC_MAX_AGE, 0.0,
PSYS_SRC_PATTERN, 8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
// PSYS_SRC_BURST_RADIUS, 0.0,
PSYS_SRC_BURST_SPEED_MIN, .01, PSYS_SRC_BURST_SPEED_MAX, 3.01,
PSYS_SRC_ANGLE_BEGIN, 1*DEG_TO_RAD, PSYS_SRC_ANGLE_END, 0*DEG_TO_RAD,
PSYS_SRC_OMEGA, <0,0,0>,
// PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1),
PSYS_PART_FLAGS, ( 0
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// | PSYS_PART_TARGET_POS_MASK
// | PSYS_PART_TARGET_LINEAR_MASK
) ] );
}
}
// (particle appearance settings)
// TEXTURE, can be an "Asset UUID" key copied from a modable texture, or the name of a texture in the prim's inventory.
// SCALE, vector's x and y can be 0.0 to 4.0. z is ignored. Values smaller than 0.04 might not get rendered.
// END_SCALE requires the INTERP_SCALE_MASK
// COLOR, red,green,blue values from 0,0,0(black) to 1,1,1 (white)
// ALPHA, 0.0 = invisible, less than 0.1 may not get seen, 1.0 = solid/opaque
// END_COLOR and END_ALPHA both require INTERP_COLOR_MASK
// (emitter controls)
// BURST_PART_COUNT 1 to 4096
// BURST_RATE 0.0 to 60.0? # of seconds between bursts, smaller = faster
// PART_MAX_AGE, 0.0 to 30.0, particle lifespan in seconds
// SRC_MAX_AGE - emitter auto-off interval 0.0 never times out. 1.0 to 60.0.
// (placement and movement settings)
// PATTERN,
// DROP, no initial velocity, direction or distance from emitter
// EXPLODE, spray in all directions
// ANGLE, "fan" shape defined by ANGLE BEGIN and END values
// ANGLE_CONE, "ring" or "cone" shapes defined by ANGLE BEGIN and END values
// ACCEL, x,y,z 0.0 to 50.0? sets a constant force, (affects all patterns)
// RADIUS 0.0 to 50.0? distance from emitter to create new particles
// (Useless with DROP pattern and FOLLOW_SRC option)
// SPEED, 0.01 to 50.0? Sets range of starting velocities. (Useless with DROP pattern.)
// ANGLE_BEGIN & END, 0.0 (up) to PI (down), (Only useful with ANGLE patterns)
// OMEGA, x,y,z 0.0 to PI? Sets distance to rotate emitter nozzle between bursts
// (Only useful with ANGLE patterns)
// TARGET_KEY, "key", (requires a TARGET option below) can be many things :
// llGetOwner()
// llGetKey() target self
// llGetLinkKey(1) target parent prim
// llGetLinkKey(llGetLinkNum() + 1) target next prim in link set
// (on/off options that affect how particles look)
// EMISSIVE identical to "full bright" setting on prims
// FOLLOW_VELOCITY particle texture 'tilts' towards the direction it's moving
// INTERP_COLOR causes color and alpha to change over time
// INTERP_SCALE causes particle size to change over time
// (on/off options that affect how particles move)
// BOUNCE particles can't go below altitude of emitter
// WIND sim's wind will push particles around
// FOLLOW_SRC makes particles move (but not rotate) if their emitter moves, (disables RADIUS)
// TARGET_POS causes particles to home in on a target object
// TARGET_LINEAR forces a DROP pattern like behavior and disables wind.

View File

@@ -18,7 +18,7 @@
// License:
// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US
// That means this must always be free.
// That means this must always be free.
// V1.1 allow longer names
@@ -306,6 +306,7 @@ default {
http_response(key request_id, integer status, list metadata, string body)
{
llSay(0,body);
if (request_id == http_request_id)
{
busy = FALSE;

View File

@@ -0,0 +1,16 @@
default {
attach(key attached) {
if (attached != NULL_KEY) {
llRequestPermissions(attached, PERMISSION_TRIGGER_ANIMATION);
} else {
llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, 0));
}
}
run_time_permissions(integer perms) {
if(perms & (PERMISSION_TRIGGER_ANIMATION))
{
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, 0));
}
}
}

View File

@@ -0,0 +1,41 @@
float delay = 0.1;
integer m_STEPS = 16;
motionTo(vector dest,rotation rot) {
integer i;
vector currentpos = llGetPos();
vector step = (dest - currentpos) / m_STEPS;
for (i = 1;i <= m_STEPS; i++)
{
if (i == (m_STEPS / 2))
{
llSetRot(rot);
}
llSetPos(currentpos + (step * i));
}
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
}
default {
state_entry() {
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
}
changed(integer what) {
if (what & CHANGED_REGION_START){
llResetScript();
}
}
sensor(integer n) {
motionTo(llDetectedPos(0) +(llRot2Fwd(llDetectedRot(0)) / 10),llDetectedRot(0));
}
no_sensor()
{
llSetTimerEvent(10);
}
timer() {
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
llSetTimerEvent(0);
}
}

View File

@@ -22,7 +22,7 @@
// License:
// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US
// That means this must always be free.
// That means this must always be free.
// Revisions:
// V1.1 allow longer names
// V1.2 code added to transmit url to other parcels, additional script
@@ -63,7 +63,7 @@ authorize() // Conditional for Owner & Group Recognition
{
authorized = TRUE;
} else {
authorized = FALSE;
authorized = FALSE;
}
}
@@ -232,10 +232,10 @@ state locking
else
{
llOwnerSay("Still loading stations, please wait a moment");
}
}
}
}
listen(integer channel, string name, key id, string message)
listen(integer channel, string name, key id, string message)
{
integer where ;
if (message == "-")
@@ -280,7 +280,7 @@ listen(integer channel, string name, key id, string message)
}
else if (message == "Lock-Out")
{
// state security;
// state security;
pubpriv = "Public";
DIALOG_CHOICES = lCategories;
pageNum = 1;
@@ -328,11 +328,15 @@ listen(integer channel, string name, key id, string message)
}
http_response(key request_id, integer status, list metadata, string body)
{
{
if (request_id == http_request_id)
{
busy = FALSE;
llSay(0,"Body is:" +body);
if (TRUE) {
return;
}
if (type == 1)
{
lCategories = llParseString2List(body,["|"],[]);
@@ -394,7 +398,7 @@ state security
}
}
}
}

View File

@@ -0,0 +1,60 @@
//
// Give with notice
//
// Fill in your server and port, if necessary, port 80 is a default.
string SERVER = "http://outworldz.com";
// * This function cases the script to sleep for 3.0 seconds.
// * If inventory is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
// * Avatar must be, or have recently been, within the same Region as sending object.
// * Does not create a folder when avatar is a prim UUID.
// o The prim must be in the same region.
//Examples
// When a user clicks this object, this script will give a folder containing everything in the objects inventory
// This can serve as a unpacker script for boxed objects
default {
http_request(key id, string method, string body)
{
llOwnerSay("Someone just got " + llGetObjectName());
}
touch_start(integer total_number) {
llHTTPRequest(SERVER + "?Name=" + llGetObjectName(),[], "");
list inventory;
string name;
integer num = llGetInventoryNumber(INVENTORY_ALL);
integer i;
for (i = 0; i < num; ++i) {
name = llGetInventoryName(INVENTORY_ALL, i);
if(llGetInventoryPermMask(name, MASK_NEXT) & PERM_COPY)
inventory += name;
else
llSay(0, "Don't have permissions to give you \""+name+"\".");
}
//we don't want to give them this script
i = llListFindList(inventory, [llGetScriptName()]);
inventory = llDeleteSubList(inventory, i, i);
if (llGetListLength(inventory) < 1) {
llSay(0, "No items to offer.");
} else {
// give folder to agent, use name of object as name of folder we are giving
llGiveInventoryList(llDetectedKey(0), llGetObjectName(), inventory);
llHTTPRequest(SERVER,[],llGetObjectName());
}
}
}

View File

@@ -0,0 +1,71 @@
// Voting script, only allows one vote per avi
// @author JB Kraft
// script from http://wiki.secondlife.com/wiki/Vote_Simple
// creative commons license
// ------------------------------------------------------------------------
// Feb 16, 2008 v1.1 - one avi, one vote
// Feb 14, 2008 v1.0 - simple voting, orig code
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// this message will be IM'd to the voter after they vote
string g_THANKS_MSG = "Thanks for voting";
// this will be in the hover text over the prim
string g_HOVER_TEXT = "Vote for Me iF YOU LIKE my SIM, Thanks";
// -- dont need to edit anything below here probably unless you want to change
// how the message is delivered when someone votes. see: touch_start --
integer g_VOTES = 0;
// list of avis that voted
list g_VOTERS;
// ------------------------------------------------------------------------
update()
{
llSetText( g_HOVER_TEXT + "\n" + (string)g_VOTES + " votes", <0,1,0>, 1.0 );
}
// ------------------------------------------------------------------------
integer addVote( key id )
{
// check memory and purge the list if we are getting full
if( llGetFreeMemory() < 1000 ) {
g_VOTERS = [];
}
// make sure they have not voted already
if( llListFindList( g_VOTERS, [id] ) == -1 ) {
g_VOTES++;
g_VOTERS = (g_VOTERS=[]) + g_VOTERS + [id];
update();
return TRUE;
}
return FALSE;
}
// ------------------------------------------------------------------------
// D E F A U L T
// ------------------------------------------------------------------------
default
{
// --------------------------------------------------------------------
state_entry()
{
update();
}
// --------------------------------------------------------------------
touch_start(integer total_number)
{
integer i;
for( i = 0; i < total_number; i++ ) {
if( addVote( llDetectedKey(i))) {
if( g_THANKS_MSG != "" ) {
// uncomment one and only one of these next 3 lines
//llWhisper( 0, g_THANKS_MESSAGE );
//llSay( 0, g_THANKS_MSG );
llInstantMessage( llDetectedKey(i), g_THANKS_MSG );
}
}
}
}
}

BIN
image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB