remove useless bak filrs, add two cat DAE files

This commit is contained in:
Fred Beckhusen
2016-05-03 09:50:29 -05:00
parent aa5c107625
commit f1dfbd01cf
43 changed files with 836 additions and 5126 deletions

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

@@ -1,9 +1,10 @@
// :SHOW: // :SHOW:1
// :CATEGORY:Animation // :CATEGORY:Animation
// :NAME:Easy Ladder // :NAME:Easy Ladder
// :AUTHOR:Ferd Frederix // :AUTHOR:Ferd Frederix
// :KEYWORDS:Ladder // :KEYWORDS:Ladder
// :CREATED:2015-07-15 10:04:12 // :CREATED:2015-07-15 10:04:12
// :EDITED:2016-05-02 11:59:18
// :ID:1081 // :ID:1081
// :NUM:1800 // :NUM:1800
// :REV:2 // :REV:2

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,17 @@
// :SHOW:
// :CATEGORY:tipjar
// :NAME:Phaze TipJar
// :AUTHOR:Ferd Frederix
// :KEYWORDS:
// :CREATED:2016-05-02 13:00:35
// :EDITED:2016-05-02 12:00:35
// :ID:1103
// :NUM:1890
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// This paricle script released butterflies from my tipjar when it was tipped.
// :CODE:
// Particle Script 0.4j // Particle Script 0.4j
// Created by Ama Omega 3-7-2004 // Created by Ama Omega 3-7-2004
// Updated by Jopsy Pendragon 5-11-2004 // Updated by Jopsy Pendragon 5-11-2004
@@ -165,4 +179,4 @@ default
} }
} }

View File

@@ -1,3 +1,17 @@
// :SHOW:
// :CATEGORY:tipjar
// :NAME:Phaze TipJar
// :AUTHOR:Ferd Frederix
// :KEYWORDS:
// :CREATED:2016-05-02 12:59:52
// :EDITED:2016-05-02 11:59:52
// :ID:1103
// :NUM:1889
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// A tipjar made with two spheres. The top will pop when touched
// :CODE:
//Keknehv Psaltery Updated Version of DONATION BOX By jean cook, ama omega, and nada epoch Debugged by YadNi Monde. //Keknehv Psaltery Updated Version of DONATION BOX By jean cook, ama omega, and nada epoch Debugged by YadNi Monde.
// changed into a butterfly dispenser by Ferd Frederix // changed into a butterfly dispenser by Ferd Frederix
// (LoL) Yea, that s a Bunch O Peeps =) // (LoL) Yea, that s a Bunch O Peeps =)
@@ -63,4 +77,4 @@ default
llSetAlpha(0.1,ALL_SIDES); llSetAlpha(0.1,ALL_SIDES);
llSetTimerEvent(0.0); llSetTimerEvent(0.0);
} }
} }

View File

@@ -0,0 +1,44 @@
// :SHOW:
// :CATEGORY:Clothing
// :NAME:PrimSkirt Builder
// :AUTHOR:Daltonic Gin
// :KEYWORDS:
// :CREATED:2015-03-17 10:31:06
// :EDITED:2015-03-17 09:31:06
// :ID:1075
// :NUM:1736
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
//
// :CODE:
Glad that you've got your copy of the prim skirt builder. First a couple of words why it appeared.
There's a person who makes my SL the most enjoyable experience, and her name is Vint Falken.
She is a great SL photo-artist (if you can afford the price for the services of a professional - then she's the right person to talk to), and a great person overall.
Looking at the LoopRez script which is used for these things, I said "what a boring work it must be!" and told her I can make something better than that.
And then I've decided to release this as full-mod under GPL license, for a few reasons:
1) I think it is a nice way to express myself to her
2) I am curious if anyone likes the tool enough that they would tip me without being required to do so :-)
3) other people (you!) can save some time not spent on boring things and spend it more productively.
4) Last but not least... I depend a lot on the GPL code IRL - and I wanted to contribute back, even in such a small extent.
Now that you've read the story and you know why - grab the manual (you can find a copy of it inside the posing stand) and look through it - and then... have fun!! :-)
Take also your time to read the EULA and the GPL license - before asking any questions or tweaking any of the permissions :-)
I will post the relevant news regarding this tool on my blog http://daltonic.blogspot.com/ under the tag "primskirtbuilder"
cheers,
Dalien
P.S. Be sure also to visit Vint's blog at http://www.vintfalken.com/ - she has quite a few nice tutorials
P.P.S. if someone sold you this build for anything other than L$0, or if you can not view the source of the scripts - please go and report them, they've been doing so in violation of GPL.

View File

@@ -1,64 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Renes Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light
// :CREATED:2015-06-11 14:41:40
// :ID:1079
// :NUM:1781
// :REV:2.1
// :WORLD:Opensim
// :DESCRIPTION:
// Configuration notecard for Lighting System
// :CODE:
// :LICENSE: CC0 (Public Domain)
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
# Configuration notecard for Lighting System
#
# Date: 31-05-2015
# Version: 2.1
verbose = YES # show more/less info during startup
switchAccess = PUBLIC # access level for switch (PUBLIC, GROUP, OWNER, GROUP+OWNER)
menuAccess = PUBLIC # access level for menu (PUBLIC, GROUP, OWNER, GROUP+OWNER)
menuPercent = 10 # increase/decrease percentage for +/- buttons
changePrimColor = YES # YES = prim color changes with light color
changeParticleColor = YES # YES = particle color changes with light color
particleTexture = # texture UUID for particle effect
particleMenu = NO # YES = "On/Off" replaced by "Particles" (particle menu)
notecardMenu = NO # YES = "On/Off" replaced by "Presets" (notecard menu)
lightGroups = NO # YES = use prim description for light groups, NO = ignore prim description
faces = -1 # color/glow/fullbright on all faces (-1), one face or comma-separated list
baseIntensity = 100 # base percentage for light intensity
# Menu defaults
colorOn = < 100, 100, 100 > # color percentage (red, green, blue) when ON
colorOff = < 100, 100, 100 > # color percentage (red, green, blue) when OFF
alphaOn = 100 # alpha percentage when ON
alphaOff = 100 # alpha percentage when OFF
intensity = 100 # light intensity percentage
radius = 50 # light radius percentage
falloff = 40 # light falloff percentage
glow = 0 # glow percentage
fullbright = YES # fullbright when ON (YES or NO)
particleSize = 20 # size percentage for particle effect
# Link messages: in
msgNumber = 10957 # number part of incoming link messages
msgSwitch = switch # string part of incoming link message: switch (on/off)
msgOn = on # string part of incoming link message: switch on
msgOff = off # string part of incoming link message: switch off
msgMenu = menu # string part of incoming link message: show menu
# Link messages: out
extButton = # "On/Off" replaced by button text (sends link message)
extNumber = 10958 # number part of outgoing link message

View File

@@ -1,189 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:42
// :EDITED:2015-06-12 12:30:32
// :ID:1079
// :NUM:1782
// :REV:2.0
// :WORLD:Opensim
// :DESCRIPTION:
// Light Bulb for Menu-controlled lighting system with many features
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Light Bulb
//
// Author: Rene10957 Resident
// Date: 31-05-2015
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Light Bulb"; // title
string version = "2.0"; // version
integer linkSet = TRUE; // LINKSET mode
integer silent = TRUE; // silent startup
// Constants
integer switchChannel = -10957; // switch channel
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
// Variables
key owner; // object owner
string particleMsg; // message for particle plugin (on/off, color, size)
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer lightGroups = (integer)llList2String(msgList, 16);
if (lightGroups && llToLower(llList2String(msgList, 0)) != llToLower(getGroup())) return;
integer on = (integer)llList2String(msgList, 1);
vector color = (vector)llList2String(msgList, 2);
float intensity = (float)llList2String(msgList, 3);
float radius = (float)llList2String(msgList, 4);
float falloff = (float)llList2String(msgList, 5);
float alpha = (float)llList2String(msgList, 6);
float glow = (float)llList2String(msgList, 7);
integer fullbright = (integer)llList2String(msgList, 8);
vector primColor = (vector)llList2String(msgList, 9);
vector particleColor = (vector)llList2String(msgList, 10);
float particleSize = (float)llList2String(msgList, 11);
float particleInc = (float)llList2String(msgList, 12);
string particleTexture = llList2String(msgList, 13);
integer particlesOn = (integer)llList2String(msgList, 14);
string faces = llList2String(msgList, 15);
// Placeholder for 16 (see above)
// Forward 10 (particleColor), 11 (particleSize), 12 (particleInc), 13 (particleTexture) and 14 (particlesOn)
// to particle script (same prim)
if (particleMsg == "") particleInc = 999; // first message after script reset: set particle size to default
list pList = [particlesOn, particleColor, particleSize, particleInc, particleTexture];
particleMsg = llList2CSV(pList); // global variable
llMessageLinked(LINK_THIS, particleChannel, particleMsg, "");
// Set light and prim properties
list faceList = llParseString2List(faces, ["<", ",", " ", ">"], []);
integer length = llGetListLength(faceList);
integer face;
integer i;
llSetLinkPrimitiveParamsFast(LINK_THIS, [
PRIM_POINT_LIGHT, on, color, intensity, radius, falloff]);
for (i = 0; i < length; ++i) {
face = (integer)llList2String(faceList, i);
llSetLinkPrimitiveParamsFast(LINK_THIS, [
PRIM_COLOR, face, primColor, alpha,
PRIM_GLOW, face, glow,
PRIM_FULLBRIGHT, face, fullbright]);
}
}
resetParticleSize(string msg)
{
list msgList = llCSV2List(msg);
list pList = llListReplaceList(msgList, [999], 3, 3);
particleMsg = llList2CSV(pList); // global variable
llMessageLinked(LINK_THIS, particleChannel, particleMsg, "");
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) state sLinkSet;
else state sRegion;
}
}
state sLinkSet
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + "-LINKSET ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == switchChannel) {
unpackMessage(msg);
}
else if (number == feedbackChannel) {
if (msg == "READY") {
llSleep(0.2); // give new particle script time to reset
if (particleMsg) resetParticleSize(particleMsg); // start particles with default size
}
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
llParticleSystem([]); // stop particles in case particle script was removed
if (particleMsg) llMessageLinked(LINK_THIS, particleChannel, particleMsg, ""); // start particles
}
}
}
state sRegion
{
state_entry()
{
llListen(switchChannel, "", "", "");
if (!silent) llWhisper(0, title + " " + version + "-REGION ready");
}
on_rez(integer start_param)
{
llResetScript();
}
listen(integer channel, string name, key id, string msg)
{
if (channel == switchChannel) if (llGetOwnerKey(id) == owner) unpackMessage(msg);
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != feedbackChannel) return;
if (msg == "READY") {
llSleep(0.2); // give new particle script time to reset
if (particleMsg) resetParticleSize(particleMsg); // start particles with default size
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
llParticleSystem([]); // stop particles in case particle script was removed
if (particleMsg) llMessageLinked(LINK_THIS, particleChannel, particleMsg, ""); // start particles
}
}
}

View File

@@ -1,187 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:43
// :EDITED:2015-06-12 12:30:32
// :ID:1079
// :NUM:1783
// :REV:2.9
// :WORLD:Opensim
// :DESCRIPTION:
// Light Bulb for Menu-controlled lighting system with many features
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Author: Rene10957 Resident
// Date: 31-05-2015
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Light Bulb"; // title
string version = "2.0"; // version
integer linkSet = FALSE; // REGION mode
integer silent = TRUE; // silent startup
// Constants
integer switchChannel = -10957; // switch channel
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
// Variables
key owner; // object owner
string particleMsg; // message for particle plugin (on/off, color, size)
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer lightGroups = (integer)llList2String(msgList, 16);
if (lightGroups && llToLower(llList2String(msgList, 0)) != llToLower(getGroup())) return;
integer on = (integer)llList2String(msgList, 1);
vector color = (vector)llList2String(msgList, 2);
float intensity = (float)llList2String(msgList, 3);
float radius = (float)llList2String(msgList, 4);
float falloff = (float)llList2String(msgList, 5);
float alpha = (float)llList2String(msgList, 6);
float glow = (float)llList2String(msgList, 7);
integer fullbright = (integer)llList2String(msgList, 8);
vector primColor = (vector)llList2String(msgList, 9);
vector particleColor = (vector)llList2String(msgList, 10);
float particleSize = (float)llList2String(msgList, 11);
float particleInc = (float)llList2String(msgList, 12);
string particleTexture = llList2String(msgList, 13);
integer particlesOn = (integer)llList2String(msgList, 14);
string faces = llList2String(msgList, 15);
// Placeholder for 16 (see above)
// Forward 10 (particleColor), 11 (particleSize), 12 (particleInc), 13 (particleTexture) and 14 (particlesOn)
// to particle script (same prim)
if (particleMsg == "") particleInc = 999; // first message after script reset: set particle size to default
list pList = [particlesOn, particleColor, particleSize, particleInc, particleTexture];
particleMsg = llList2CSV(pList); // global variable
llMessageLinked(LINK_THIS, particleChannel, particleMsg, "");
// Set light and prim properties
list faceList = llParseString2List(faces, ["<", ",", " ", ">"], []);
integer length = llGetListLength(faceList);
integer face;
integer i;
llSetLinkPrimitiveParamsFast(LINK_THIS, [
PRIM_POINT_LIGHT, on, color, intensity, radius, falloff]);
for (i = 0; i < length; ++i) {
face = (integer)llList2String(faceList, i);
llSetLinkPrimitiveParamsFast(LINK_THIS, [
PRIM_COLOR, face, primColor, alpha,
PRIM_GLOW, face, glow,
PRIM_FULLBRIGHT, face, fullbright]);
}
}
resetParticleSize(string msg)
{
list msgList = llCSV2List(msg);
list pList = llListReplaceList(msgList, [999], 3, 3);
particleMsg = llList2CSV(pList); // global variable
llMessageLinked(LINK_THIS, particleChannel, particleMsg, "");
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) state sLinkSet;
else state sRegion;
}
}
state sLinkSet
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + "-LINKSET ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == switchChannel) {
unpackMessage(msg);
}
else if (number == feedbackChannel) {
if (msg == "READY") {
llSleep(0.2); // give new particle script time to reset
if (particleMsg) resetParticleSize(particleMsg); // start particles with default size
}
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
llParticleSystem([]); // stop particles in case particle script was removed
if (particleMsg) llMessageLinked(LINK_THIS, particleChannel, particleMsg, ""); // start particles
}
}
}
state sRegion
{
state_entry()
{
llListen(switchChannel, "", "", "");
if (!silent) llWhisper(0, title + " " + version + "-REGION ready");
}
on_rez(integer start_param)
{
llResetScript();
}
listen(integer channel, string name, key id, string msg)
{
if (channel == switchChannel) if (llGetOwnerKey(id) == owner) unpackMessage(msg);
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != feedbackChannel) return;
if (msg == "READY") {
llSleep(0.2); // give new particle script time to reset
if (particleMsg) resetParticleSize(particleMsg); // start particles with default size
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
llParticleSystem([]); // stop particles in case particle script was removed
if (particleMsg) llMessageLinked(LINK_THIS, particleChannel, particleMsg, ""); // start particles
}
}
}

View File

@@ -1,724 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:45
// :EDITED:2015-06-12 12:30:32
// :ID:1079
// :NUM:1784
// :REV:2.1
// :WORLD:Opensim
// :DESCRIPTION:
// Light Switch
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Light Switch
//
// Author: Rene10957 Resident
// Date: 31-05-2015
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Light Switch"; // title
string version = "2.1"; // version
integer linkSet = TRUE; // LINKSET mode
// Constants
integer _PUBLIC_ = 1; // public access bit
integer _GROUP_ = 2; // group access bit
integer _OWNER_ = 4; // owner access bit
integer _GRPOWN_ = 6; // group + owner
integer switchChannel = -10957; // switch channel
float maxRed = 1.0; // max. red
float maxGreen = 1.0; // max. green
float maxBlue = 1.0; // max. blue
float maxRadius = 20.0; // max. light radius
float maxFalloff = 2.0; // max. light falloff
float maxGlow = 1.0; // max. prim glow
float maxAlpha = 1.0; // max. prim alpha
string configPrefix = "config"; // prefix for configuration notecards
string configSeparator = ":"; // separator between prefix and name
string defNotecard = "Default"; // default notecard
// Notecard variables
integer verbose = FALSE; // show more/less info during startup
integer switchAccess; // access level for switch
integer menuAccess; // access level for menu
integer msgNumber; // number part of incoming link messages
string msgSwitch; // string part of incoming link message: switch (on/off)
string msgOn; // string part of incoming link message: switch on
string msgOff; // string part of incoming link message: switch off
string msgMenu; // string part of incoming link message: show menu
integer percent; // increase/decrease percentage for +/- buttons
integer changePrimColor = FALSE; // TRUE = prim color changes with light color, FALSE = white
integer changeParticleColor = FALSE; // TRUE = particle color changes with light color, FALSE = white
integer particleInc; // increase/decrease percentage for particle effect (menu)
string particleTexture; // texture UUID for particle effect
integer particleMenu = FALSE; // TRUE = "On/Off" replaced by "Particles" (particle menu)
integer notecardMenu = FALSE; // TRUE = "On/Off" replaced by "Presets" (notecard menu)
string extButton; // "On/Off" replaced by button text (sends link message)
integer extNumber; // number part of outgoing link message
integer lightGroups = FALSE; // TRUE = use prim description for light groups, FALSE = ignore prim description
string faces; // color/glow/fullbright on all faces (ALL_SIDES = -1), one face or CSV list
integer baseIntensity; // base for light intensity
// Notecard variables: menu defaults
vector defColor; // default color (R,G,B)
vector defColorOff; // default color (R,G,B) when OFF
integer defAlpha; // default prim alpha
integer defAlphaOff; // default prim alpha when OFF
integer defIntensity; // default light intensity
integer defRadius; // default light radius
integer defFalloff; // default light falloff
integer defGlow; // default prim glow
integer defFullbright = FALSE; // default fullbright
integer defParticleSize; // default particle size
// Variables
key owner; // object owner
key user; // key of last avatar to touch object
list notecardButtons; // list of notecards in inventory
string notecard; // notecard name
integer line; // notecard line
integer loading = FALSE; // notecard loading
integer menuChannel; // main menu channel
integer colorChannel; // color menu channel
integer particleChannel; // particle menu channel
integer notecardChannel; // notecard menu channel
integer menuHandle; // handle for main menu listener
integer colorHandle; // handle for color menu listener
integer particleHandle; // handle for particle menu listener
integer notecardHandle; // handle for notecard menu listener
integer on = FALSE; // on-off switch
integer particles = TRUE; // particles on/off
integer perRed; // percent red
integer perGreen; // percent green
integer perBlue; // percent blue
integer perAlpha; // percent prim alpha
integer perRedOff; // percent red when OFF
integer perGreenOff; // percent green when OFF
integer perBlueOff; // percent blue when OFF
integer perAlphaOff; // percent prim alpha when OFF
integer perIntensity; // percent light intensity
integer perRadius; // percent light radius
integer perFalloff; // percent light falloff
integer perGlow; // percent prim glow
integer fullbright = TRUE; // fullbright
// Functions
list orderButtons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) +
llList2List(buttons, -12, -10);
}
discoverNotecards()
{
llSetText("Discovering notecards...", <1,1,1>, 1.0);
notecardButtons = [];
integer i;
integer pos;
integer number = llGetInventoryNumber(INVENTORY_NOTECARD);
string name;
string prefix;
string suffix;
for (i = 0; i < number; ++i) {
name = llGetInventoryName(INVENTORY_NOTECARD, i);
pos = llSubStringIndex(name, configSeparator);
if (pos > -1) {
prefix = llGetSubString(name, 0, pos - 1);
suffix = llGetSubString(name, pos + 1, -1);
if (prefix == configPrefix && suffix != defNotecard && llGetListLength(notecardButtons) < 10)
notecardButtons += suffix;
}
}
notecardButtons = llListSort(notecardButtons, 1, TRUE); // sort ascending
if (llGetInventoryType(configPrefix + configSeparator + defNotecard) == INVENTORY_NOTECARD)
notecardButtons += defNotecard;
if (llGetListLength(notecardButtons) > 0) {
notecardButtons += "Main menu";
notecardButtons = orderButtons(notecardButtons); // reverse row order
}
llSetText("", ZERO_VECTOR, 0.0);
}
integer accessGranted(key user, integer access)
{
integer bitmask = _PUBLIC_;
if (user == owner) bitmask += _OWNER_;
if (llSameGroup(user)) bitmask += _GROUP_;
return (bitmask & access);
}
integer checkAccess(string par, string val)
{
if (llToLower(val) == "public") return _PUBLIC_;
if (llToLower(val) == "group") return _GROUP_;
if (llToLower(val) == "owner") return _OWNER_;
if (llToLower(val) == "group+owner") return _GRPOWN_;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to PUBLIC");
return _PUBLIC_;
}
integer checkInt(string par, integer val, integer min, integer max)
{
if (val < min || val > max) {
if (val < min) val = min;
else if (val > max) val = max;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to " + (string)val);
}
return val;
}
vector checkVector(string par, vector val)
{
if (val == ZERO_VECTOR) {
val = <100,100,100>;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to " + (string)val);
}
return val;
}
integer checkYesNo(string par, string val)
{
if (llToLower(val) == "yes") return TRUE;
if (llToLower(val) == "no") return FALSE;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to NO");
return FALSE;
}
string checkKey(string par, string val)
{
if ((key)val) return val;
if (val == "") return val;
llWhisper(0, "[Notecard] " + par + " out of range (not a valid key)");
return "";
}
string truncMenuButton(string par, string val)
{
string trunc = llBase64ToString(llGetSubString(llStringToBase64(val), 0, 31));
if (val != trunc) llWhisper(0, "[Notecard] " + par + " will be truncated to 24 bytes");
return trunc;
}
loadNotecard()
{
verbose = TRUE;
switchAccess = _PUBLIC_;
menuAccess = _PUBLIC_;
msgNumber = 10957;
msgSwitch = "switch";
msgOn = "on";
msgOff = "off";
msgMenu = "menu";
percent = 10;
changePrimColor = TRUE;
changeParticleColor = TRUE;
particleTexture = "";
particleMenu = FALSE;
notecardMenu = FALSE;
extButton = "";
extNumber = 10958;
lightGroups = FALSE;
faces = "-1";
baseIntensity = 100;
defColor = <100,100,100>;
defColorOff = <100,100,100>;
defAlpha = 100;
defAlphaOff = 100;
defIntensity = 100;
defRadius = 50;
defFalloff = 40;
defGlow = 0;
defFullbright = TRUE;
defParticleSize = 20;
line = 0;
if (llGetInventoryType(notecard) == INVENTORY_NOTECARD) {
loading = TRUE;
llSetText("Loading notecard...", <1,1,1>, 1.0);
llGetNotecardLine(notecard, line);
}
else {
reset();
particleInc = 999; // reset particle size in plugin script
sendMessage(getGroup());
if (verbose) {
llWhisper(0, "Notecard \"" + notecard + "\" not found or empty, using defaults");
llWhisper(0, "Touch to turn light on or off");
llWhisper(0, "Long touch to show menu");
if (linkSet) llWhisper(0, title + " " + version + "-LINKSET ready");
else llWhisper(0, title + " " + version + "-REGION ready");
}
}
}
readNotecard (string ncLine)
{
string ncData = llStringTrim(ncLine, STRING_TRIM);
if (llStringLength(ncData) > 0 && llGetSubString(ncData, 0, 0) != "#") {
list ncList = llParseString2List(ncData, ["=","#"], []); // split into parameter, value, comment
string par = llStringTrim(llList2String(ncList, 0), STRING_TRIM);
string val = llStringTrim(llList2String(ncList, 1), STRING_TRIM);
string lcpar = llToLower(par);
if (lcpar == "verbose") verbose = checkYesNo(par, val);
else if (lcpar == "switchaccess") switchAccess = checkAccess(par, val);
else if (lcpar == "menuaccess") menuAccess = checkAccess(par, val);
else if (lcpar == "msgnumber") msgNumber = (integer)val;
else if (lcpar == "msgswitch") msgSwitch = truncMenuButton(par, val);
else if (lcpar == "msgon") msgOn = truncMenuButton(par, val);
else if (lcpar == "msgoff") msgOff = truncMenuButton(par, val);
else if (lcpar == "msgmenu") msgMenu = truncMenuButton(par, val);
else if (lcpar == "menupercent") percent = checkInt(par, (integer)val, 1, 100);
else if (lcpar == "changeprimcolor") changePrimColor = checkYesNo(par, val);
else if (lcpar == "changeparticlecolor") changeParticleColor = checkYesNo(par, val);
else if (lcpar == "particletexture") particleTexture = checkKey(par, val);
else if (lcpar == "particlemenu") particleMenu = checkYesNo(par, val);
else if (lcpar == "notecardmenu") notecardMenu = checkYesNo(par, val);
else if (lcpar == "extbutton") extButton = truncMenuButton(par, val);
else if (lcpar == "extnumber") extNumber = (integer)val;
else if (lcpar == "lightgroups") lightGroups = checkYesNo(par, val);
else if (lcpar == "faces") faces = truncMenuButton(par, val);
else if (lcpar == "baseintensity") baseIntensity = checkInt(par, (integer)val, 1, 100);
else if (lcpar == "coloron") defColor = checkVector(par, (vector)val);
else if (lcpar == "coloroff") defColorOff = checkVector(par, (vector)val);
else if (lcpar == "alphaon") defAlpha = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "alphaoff") defAlphaOff = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "intensity") defIntensity = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "radius") defRadius = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "falloff") defFalloff = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "glow") defGlow = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "fullbright") defFullbright = checkYesNo(par, val);
else if (lcpar == "particlesize") defParticleSize = checkInt(par, (integer)val, 1, 100);
else llWhisper(0, "Unknown parameter in notecard line " + (string)(line + 1) + ": " + par);
}
line++;
llGetNotecardLine(notecard, line);
}
menuDialog (key id)
{
string strOn = "OFF"; if (on) strOn = "ON";
string strLinkSet = "REGION"; if (linkSet) strLinkSet = "LINKSET";
string strFullbright = "NO"; if (fullbright) strFullbright = "YES";
string strButton = "On/Off"; if (particleMenu) strButton = "Particles";
else if (notecardMenu) strButton = "Presets";
else if (extButton) strButton = extButton;
menuChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(menuHandle);
menuHandle = llListen(menuChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, title + " " + version +
"\n\nIntensity: " + (string)perIntensity + "%\t\tState: " + strOn +
"\nRadius: " + (string)perRadius + "%\t\tFullbright: " + strFullbright +
"\nFalloff: " + (string)perFalloff + "%\t\tMode: " + strLinkSet +
"\nGlow: " + (string)perGlow + "%\t\tGroup: " + getGroup(), [
"-Glow", "+Glow", strButton,
"-Falloff", "+Falloff", "Reset",
"-Radius", "+Radius", "Fullbright",
"-Intensity", "+Intensity", "Color" ],
menuChannel);
}
colorDialog (key id)
{
colorChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(colorHandle);
colorHandle = llListen(colorChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
if (on) {
llDialog(id, "Color & Alpha when ON" +
"\n\nRed: " + (string)perRed + "%" +
"\nGreen: " + (string)perGreen + "%" +
"\nBlue: " + (string)perBlue + "%" +
"\nAlpha: " + (string)perAlpha + "%", [
"-Alpha", "+Alpha", "Main menu",
"-Blue", "+Blue", "B min/max",
"-Green", "+Green", "G min/max",
"-Red", "+Red", "R min/max" ],
colorChannel);
}
else {
llDialog(id, "Color & Alpha when OFF" +
"\n\nRed: " + (string)perRedOff + "%" +
"\nGreen: " + (string)perGreenOff + "%" +
"\nBlue: " + (string)perBlueOff + "%" +
"\nAlpha: " + (string)perAlphaOff + "%", [
"-Alpha", "+Alpha", "Main menu",
"-Blue", "+Blue", "B min/max",
"-Green", "+Green", "G min/max",
"-Red", "+Red", "R min/max" ],
colorChannel);
}
}
particleDialog (key id)
{
string strLightOn = "OFF"; if (on) strLightOn = "ON";
string strParticlesOn = "OFF"; if (particles) strParticlesOn = "ON";
particleChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(particleHandle);
particleHandle = llListen(particleChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, "Particle effect" +
"\n\nLight: " + strLightOn +
"\nParticles: " + strParticlesOn, [
"Min", "Max", "Main menu",
"-10%", "+10%", "Reset",
"-5%", "+5%", "Part. on/off",
"-1%", "+1%", "Light on/off" ],
particleChannel);
}
notecardDialog (key id)
{
string name = llGetSubString(notecard, llStringLength(configPrefix) + llStringLength(configSeparator), -1);
notecardChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(notecardHandle);
notecardHandle = llListen(notecardChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, "Configuration notecards\n\nLoaded notecard: " + name, notecardButtons, notecardChannel);
}
string getGroup()
{
if (!lightGroups) return "None";
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
float percentage (integer per, float num)
{
return num / 100.0 * (float)per;
}
integer min (integer x, integer y)
{
if (x < y) return x; else return y;
}
integer max (integer x, integer y)
{
if (x > y) return x; else return y;
}
reset()
{
perRed = (integer)defColor.x;
perGreen = (integer)defColor.y;
perBlue = (integer)defColor.z;
perRedOff = (integer)defColorOff.x;
perGreenOff = (integer)defColorOff.y;
perBlueOff = (integer)defColorOff.z;
perAlpha = defAlpha;
perAlphaOff = defAlphaOff;
perIntensity = defIntensity;
perRadius = defRadius;
perFalloff = defFalloff;
perGlow = defGlow;
fullbright = defFullbright;
}
sendMessage(string group)
{
vector color;
vector colorOn;
vector colorOff;
float intensity;
float radius;
float falloff;
float alpha;
float glow;
integer fullbr;
vector primColor;
vector particleColor;
integer particlesOn;
colorOn.x = percentage(perRed, maxRed);
colorOn.y = percentage(perGreen, maxGreen);
colorOn.z = percentage(perBlue, maxBlue);
colorOff.x = percentage(perRedOff, maxRed);
colorOff.y = percentage(perGreenOff, maxGreen);
colorOff.z = percentage(perBlueOff, maxBlue);
if (on) {
color = colorOn;
intensity = percentage(perIntensity, (float)baseIntensity / 100.0);
radius = percentage(perRadius, maxRadius);
falloff = percentage(perFalloff, maxFalloff);
alpha = percentage(perAlpha, maxAlpha);
glow = percentage(perGlow, maxGlow);
fullbr = fullbright;
if (changePrimColor) primColor = color;
else primColor = colorOff;
if (changeParticleColor) particleColor = color;
else particleColor = colorOff;
particlesOn = particles;
}
else {
color = colorOff;
alpha = percentage(perAlphaOff, maxAlpha);
glow = 0.0;
fullbr = FALSE;
primColor = color;
particlesOn = FALSE;
}
list msgList = [group, on, color, intensity, radius, falloff, alpha, glow, fullbr,
primColor, particleColor, defParticleSize, particleInc, particleTexture, particlesOn,
"<" + faces + ">", lightGroups];
string msg = llList2CSV(msgList);
particleInc = 0;
if (linkSet) llMessageLinked(LINK_SET, switchChannel, msg, "");
else llRegionSay(switchChannel, msg);
}
default
{
state_entry()
{
owner = llGetOwner();
notecard = configPrefix + configSeparator + defNotecard;
discoverNotecards();
loadNotecard();
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
llResetTime();
}
touch_end(integer total_number)
{
if (loading) {
llWhisper(0, "Notecard is still loading");
return;
}
user = llDetectedKey(0);
if (llGetTime() > 1.0) {
if (accessGranted(user, menuAccess)) menuDialog(user);
else llInstantMessage(user, "[Menu] Access denied");
}
else {
if (accessGranted(user, switchAccess)) {
on = !on;
sendMessage(getGroup());
}
else llInstantMessage(user, "[Switch] Access denied");
}
}
listen(integer channel, string name, key id, string msg)
{
llSetTimerEvent(0);
if (channel == menuChannel) {
llListenRemove(menuHandle);
if (msg == "-Intensity") perIntensity = max(perIntensity - percent, 0);
else if (msg == "-Radius") perRadius = max(perRadius - percent, 0);
else if (msg == "-Falloff") perFalloff = max(perFalloff - percent, 0);
else if (msg == "-Glow") perGlow = max(perGlow - percent, 0);
else if (msg == "+Intensity") perIntensity = min(perIntensity + percent, 100);
else if (msg == "+Radius") perRadius = min(perRadius + percent, 100);
else if (msg == "+Falloff") perFalloff = min(perFalloff + percent, 100);
else if (msg == "+Glow") perGlow = min(perGlow + percent, 100);
else if (msg == "Color") colorDialog(id);
else if (msg == "Fullbright") fullbright = !fullbright;
else if (msg == "Reset") reset();
else if (msg == "On/Off") on = !on;
else if (msg == "Particles") particleDialog(id);
else if (msg == "Presets") {
if (llGetListLength(notecardButtons) > 0) notecardDialog(id);
else llWhisper(0, "No configuration notecards found");
}
else if (msg == extButton) llMessageLinked(LINK_SET, extNumber, msg, id);
if (msg != "Color" && msg != "Particles" && msg != "Presets" && msg != extButton) {
sendMessage(getGroup());
menuDialog(id);
}
}
else if (channel == colorChannel) {
llListenRemove(colorHandle);
if (on) {
if (msg == "-Red") perRed = max(perRed - percent, 0);
else if (msg == "-Green") perGreen = max(perGreen - percent, 0);
else if (msg == "-Blue") perBlue = max(perBlue - percent, 0);
else if (msg == "-Alpha") perAlpha = max(perAlpha - percent, 0);
else if (msg == "+Red") perRed = min(perRed + percent, 100);
else if (msg == "+Green") perGreen = min(perGreen + percent, 100);
else if (msg == "+Blue") perBlue = min(perBlue + percent, 100);
else if (msg == "+Alpha") perAlpha = min(perAlpha + percent, 100);
else if (msg == "R min/max") { if (perRed) perRed = 0; else perRed = 100; }
else if (msg == "G min/max") { if (perGreen) perGreen = 0; else perGreen = 100; }
else if (msg == "B min/max") { if (perBlue) perBlue = 0; else perBlue = 100; }
else if (msg == "Main menu") menuDialog(id);
}
else {
if (msg == "-Red") perRedOff = max(perRedOff - percent, 0);
else if (msg == "-Green") perGreenOff = max(perGreenOff - percent, 0);
else if (msg == "-Blue") perBlueOff = max(perBlueOff - percent, 0);
else if (msg == "-Alpha") perAlphaOff = max(perAlphaOff - percent, 0);
else if (msg == "+Red") perRedOff = min(perRedOff + percent, 100);
else if (msg == "+Green") perGreenOff = min(perGreenOff + percent, 100);
else if (msg == "+Blue") perBlueOff = min(perBlueOff + percent, 100);
else if (msg == "+Alpha") perAlphaOff = min(perAlphaOff + percent, 100);
else if (msg == "R min/max") { if (perRedOff) perRedOff = 0; else perRedOff = 100; }
else if (msg == "G min/max") { if (perGreenOff) perGreenOff = 0; else perGreenOff = 100; }
else if (msg == "B min/max") { if (perBlueOff) perBlueOff = 0; else perBlueOff = 100; }
else if (msg == "Main menu") menuDialog(id);
}
if (msg != "Main menu") {
sendMessage(getGroup());
colorDialog(id);
}
}
else if (channel == particleChannel) {
llListenRemove(particleHandle);
if (msg == "-1%") particleInc = -1;
else if (msg == "+1%") particleInc = 1;
else if (msg == "-5%") particleInc = -5;
else if (msg == "+5%") particleInc = 5;
else if (msg == "-10%") particleInc = -10;
else if (msg == "+10%") particleInc = 10;
else if (msg == "Min") particleInc = -100;
else if (msg == "Max") particleInc = 100;
else if (msg == "Light on/off") on = !on;
else if (msg == "Part. on/off") particles = !particles;
else if (msg == "Reset") particleInc = 999; // reset particle size
else if (msg == "Main menu") menuDialog(id);
if (msg != "Main menu") {
sendMessage(getGroup());
particleDialog(id);
}
}
else if (channel == notecardChannel) {
llListenRemove(notecardHandle);
if (msg == "Main menu") menuDialog(id);
else {
notecard = configPrefix + configSeparator + msg;
loadNotecard();
}
}
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != msgNumber) return;
if (loading) {
llWhisper(0, "Notecard is still loading");
return;
}
if (id) user = id;
else {
llWhisper(0, "A valid avatar key must be provided in the link message");
return;
}
if (msg == msgSwitch) {
if (accessGranted(id, switchAccess)) {
on = !on;
sendMessage(getGroup());
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgOn) {
if (accessGranted(id, switchAccess)) {
if (!on) {
on = TRUE;
sendMessage(getGroup());
}
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgOff) {
if (accessGranted(id, switchAccess)) {
if (on) {
on = FALSE;
sendMessage(getGroup());
}
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgMenu) {
if (accessGranted(id, menuAccess)) menuDialog(id);
else llInstantMessage(id, "[Menu] Access denied");
}
}
dataserver(key req, string data)
{
if (data == EOF) {
defColor.x = checkInt("ColorOn (RED)", (integer)defColor.x, 0, 100);
defColor.y = checkInt("ColorOn (GREEN)", (integer)defColor.y, 0, 100);
defColor.z = checkInt("ColorOn (BLUE)", (integer)defColor.z, 0, 100);
defColorOff.x = checkInt("ColorOff (RED)", (integer)defColorOff.x, 0, 100);
defColorOff.y = checkInt("ColorOff (GREEN)", (integer)defColorOff.y, 0, 100);
defColorOff.z = checkInt("ColorOff (BLUE)", (integer)defColorOff.z, 0, 100);
reset();
particleInc = 999; // reset particle size in plugin script
sendMessage(getGroup());
if (verbose) if (user) {} else {
llWhisper(0, "Touch to turn light on or off");
llWhisper(0, "Long touch to show menu");
if (linkSet) llWhisper(0, title + " " + version + "-LINKSET ready");
else llWhisper(0, title + " " + version + "-REGION ready");
}
loading = FALSE;
llSetText("", ZERO_VECTOR, 0.0);
if (user) notecardDialog(user);
}
else {
readNotecard(data);
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
user = "";
discoverNotecards();
loadNotecard();
}
}
timer()
{
llSetTimerEvent(0);
llListenRemove(menuHandle);
llListenRemove(colorHandle);
llListenRemove(particleHandle);
llListenRemove(notecardHandle);
}
}

View File

@@ -1,719 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:50
// :EDITED:2015-06-12 12:30:32
// :ID:1079
// :NUM:1785
// :REV:2.1
// :WORLD:Opensim
// :DESCRIPTION:
// Light Switch for region
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Light Switch
//
// Author: Rene10957 Resident
// Date: 31-05-2015
string title = "Light Switch"; // title
string version = "2.1"; // version
integer linkSet = FALSE; // REGION mode
// Constants
integer _PUBLIC_ = 1; // public access bit
integer _GROUP_ = 2; // group access bit
integer _OWNER_ = 4; // owner access bit
integer _GRPOWN_ = 6; // group + owner
integer switchChannel = -10957; // switch channel
float maxRed = 1.0; // max. red
float maxGreen = 1.0; // max. green
float maxBlue = 1.0; // max. blue
float maxRadius = 20.0; // max. light radius
float maxFalloff = 2.0; // max. light falloff
float maxGlow = 1.0; // max. prim glow
float maxAlpha = 1.0; // max. prim alpha
string configPrefix = "config"; // prefix for configuration notecards
string configSeparator = ":"; // separator between prefix and name
string defNotecard = "Default"; // default notecard
// Notecard variables
integer verbose = FALSE; // show more/less info during startup
integer switchAccess; // access level for switch
integer menuAccess; // access level for menu
integer msgNumber; // number part of incoming link messages
string msgSwitch; // string part of incoming link message: switch (on/off)
string msgOn; // string part of incoming link message: switch on
string msgOff; // string part of incoming link message: switch off
string msgMenu; // string part of incoming link message: show menu
integer percent; // increase/decrease percentage for +/- buttons
integer changePrimColor = FALSE; // TRUE = prim color changes with light color, FALSE = white
integer changeParticleColor = FALSE; // TRUE = particle color changes with light color, FALSE = white
integer particleInc; // increase/decrease percentage for particle effect (menu)
string particleTexture; // texture UUID for particle effect
integer particleMenu = FALSE; // TRUE = "On/Off" replaced by "Particles" (particle menu)
integer notecardMenu = FALSE; // TRUE = "On/Off" replaced by "Presets" (notecard menu)
string extButton; // "On/Off" replaced by button text (sends link message)
integer extNumber; // number part of outgoing link message
integer lightGroups = FALSE; // TRUE = use prim description for light groups, FALSE = ignore prim description
string faces; // color/glow/fullbright on all faces (ALL_SIDES = -1), one face or CSV list
integer baseIntensity; // base for light intensity
// Notecard variables: menu defaults
vector defColor; // default color (R,G,B)
vector defColorOff; // default color (R,G,B) when OFF
integer defAlpha; // default prim alpha
integer defAlphaOff; // default prim alpha when OFF
integer defIntensity; // default light intensity
integer defRadius; // default light radius
integer defFalloff; // default light falloff
integer defGlow; // default prim glow
integer defFullbright = FALSE; // default fullbright
integer defParticleSize; // default particle size
// Variables
key owner; // object owner
key user; // key of last avatar to touch object
list notecardButtons; // list of notecards in inventory
string notecard; // notecard name
integer line; // notecard line
integer loading = FALSE; // notecard loading
integer menuChannel; // main menu channel
integer colorChannel; // color menu channel
integer particleChannel; // particle menu channel
integer notecardChannel; // notecard menu channel
integer menuHandle; // handle for main menu listener
integer colorHandle; // handle for color menu listener
integer particleHandle; // handle for particle menu listener
integer notecardHandle; // handle for notecard menu listener
integer on = FALSE; // on-off switch
integer particles = TRUE; // particles on/off
integer perRed; // percent red
integer perGreen; // percent green
integer perBlue; // percent blue
integer perAlpha; // percent prim alpha
integer perRedOff; // percent red when OFF
integer perGreenOff; // percent green when OFF
integer perBlueOff; // percent blue when OFF
integer perAlphaOff; // percent prim alpha when OFF
integer perIntensity; // percent light intensity
integer perRadius; // percent light radius
integer perFalloff; // percent light falloff
integer perGlow; // percent prim glow
integer fullbright = TRUE; // fullbright
// Functions
list orderButtons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) +
llList2List(buttons, -12, -10);
}
discoverNotecards()
{
llSetText("Discovering notecards...", <1,1,1>, 1.0);
notecardButtons = [];
integer i;
integer pos;
integer number = llGetInventoryNumber(INVENTORY_NOTECARD);
string name;
string prefix;
string suffix;
for (i = 0; i < number; ++i) {
name = llGetInventoryName(INVENTORY_NOTECARD, i);
pos = llSubStringIndex(name, configSeparator);
if (pos > -1) {
prefix = llGetSubString(name, 0, pos - 1);
suffix = llGetSubString(name, pos + 1, -1);
if (prefix == configPrefix && suffix != defNotecard && llGetListLength(notecardButtons) < 10)
notecardButtons += suffix;
}
}
notecardButtons = llListSort(notecardButtons, 1, TRUE); // sort ascending
if (llGetInventoryType(configPrefix + configSeparator + defNotecard) == INVENTORY_NOTECARD)
notecardButtons += defNotecard;
if (llGetListLength(notecardButtons) > 0) {
notecardButtons += "Main menu";
notecardButtons = orderButtons(notecardButtons); // reverse row order
}
llSetText("", ZERO_VECTOR, 0.0);
}
integer accessGranted(key user, integer access)
{
integer bitmask = _PUBLIC_;
if (user == owner) bitmask += _OWNER_;
if (llSameGroup(user)) bitmask += _GROUP_;
return (bitmask & access);
}
integer checkAccess(string par, string val)
{
if (llToLower(val) == "public") return _PUBLIC_;
if (llToLower(val) == "group") return _GROUP_;
if (llToLower(val) == "owner") return _OWNER_;
if (llToLower(val) == "group+owner") return _GRPOWN_;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to PUBLIC");
return _PUBLIC_;
}
integer checkInt(string par, integer val, integer min, integer max)
{
if (val < min || val > max) {
if (val < min) val = min;
else if (val > max) val = max;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to " + (string)val);
}
return val;
}
vector checkVector(string par, vector val)
{
if (val == ZERO_VECTOR) {
val = <100,100,100>;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to " + (string)val);
}
return val;
}
integer checkYesNo(string par, string val)
{
if (llToLower(val) == "yes") return TRUE;
if (llToLower(val) == "no") return FALSE;
llWhisper(0, "[Notecard] " + par + " out of range, corrected to NO");
return FALSE;
}
string checkKey(string par, string val)
{
if ((key)val) return val;
if (val == "") return val;
llWhisper(0, "[Notecard] " + par + " out of range (not a valid key)");
return "";
}
string truncMenuButton(string par, string val)
{
string trunc = llBase64ToString(llGetSubString(llStringToBase64(val), 0, 31));
if (val != trunc) llWhisper(0, "[Notecard] " + par + " will be truncated to 24 bytes");
return trunc;
}
loadNotecard()
{
verbose = TRUE;
switchAccess = _PUBLIC_;
menuAccess = _PUBLIC_;
msgNumber = 10957;
msgSwitch = "switch";
msgOn = "on";
msgOff = "off";
msgMenu = "menu";
percent = 10;
changePrimColor = TRUE;
changeParticleColor = TRUE;
particleTexture = "";
particleMenu = FALSE;
notecardMenu = FALSE;
extButton = "";
extNumber = 10958;
lightGroups = FALSE;
faces = "-1";
baseIntensity = 100;
defColor = <100,100,100>;
defColorOff = <100,100,100>;
defAlpha = 100;
defAlphaOff = 100;
defIntensity = 100;
defRadius = 50;
defFalloff = 40;
defGlow = 0;
defFullbright = TRUE;
defParticleSize = 20;
line = 0;
if (llGetInventoryType(notecard) == INVENTORY_NOTECARD) {
loading = TRUE;
llSetText("Loading notecard...", <1,1,1>, 1.0);
llGetNotecardLine(notecard, line);
}
else {
reset();
particleInc = 999; // reset particle size in plugin script
sendMessage(getGroup());
if (verbose) {
llWhisper(0, "Notecard \"" + notecard + "\" not found or empty, using defaults");
llWhisper(0, "Touch to turn light on or off");
llWhisper(0, "Long touch to show menu");
if (linkSet) llWhisper(0, title + " " + version + "-LINKSET ready");
else llWhisper(0, title + " " + version + "-REGION ready");
}
}
}
readNotecard (string ncLine)
{
string ncData = llStringTrim(ncLine, STRING_TRIM);
if (llStringLength(ncData) > 0 && llGetSubString(ncData, 0, 0) != "#") {
list ncList = llParseString2List(ncData, ["=","#"], []); // split into parameter, value, comment
string par = llStringTrim(llList2String(ncList, 0), STRING_TRIM);
string val = llStringTrim(llList2String(ncList, 1), STRING_TRIM);
string lcpar = llToLower(par);
if (lcpar == "verbose") verbose = checkYesNo(par, val);
else if (lcpar == "switchaccess") switchAccess = checkAccess(par, val);
else if (lcpar == "menuaccess") menuAccess = checkAccess(par, val);
else if (lcpar == "msgnumber") msgNumber = (integer)val;
else if (lcpar == "msgswitch") msgSwitch = truncMenuButton(par, val);
else if (lcpar == "msgon") msgOn = truncMenuButton(par, val);
else if (lcpar == "msgoff") msgOff = truncMenuButton(par, val);
else if (lcpar == "msgmenu") msgMenu = truncMenuButton(par, val);
else if (lcpar == "menupercent") percent = checkInt(par, (integer)val, 1, 100);
else if (lcpar == "changeprimcolor") changePrimColor = checkYesNo(par, val);
else if (lcpar == "changeparticlecolor") changeParticleColor = checkYesNo(par, val);
else if (lcpar == "particletexture") particleTexture = checkKey(par, val);
else if (lcpar == "particlemenu") particleMenu = checkYesNo(par, val);
else if (lcpar == "notecardmenu") notecardMenu = checkYesNo(par, val);
else if (lcpar == "extbutton") extButton = truncMenuButton(par, val);
else if (lcpar == "extnumber") extNumber = (integer)val;
else if (lcpar == "lightgroups") lightGroups = checkYesNo(par, val);
else if (lcpar == "faces") faces = truncMenuButton(par, val);
else if (lcpar == "baseintensity") baseIntensity = checkInt(par, (integer)val, 1, 100);
else if (lcpar == "coloron") defColor = checkVector(par, (vector)val);
else if (lcpar == "coloroff") defColorOff = checkVector(par, (vector)val);
else if (lcpar == "alphaon") defAlpha = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "alphaoff") defAlphaOff = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "intensity") defIntensity = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "radius") defRadius = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "falloff") defFalloff = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "glow") defGlow = checkInt(par, (integer)val, 0, 100);
else if (lcpar == "fullbright") defFullbright = checkYesNo(par, val);
else if (lcpar == "particlesize") defParticleSize = checkInt(par, (integer)val, 1, 100);
else llWhisper(0, "Unknown parameter in notecard line " + (string)(line + 1) + ": " + par);
}
line++;
llGetNotecardLine(notecard, line);
}
menuDialog (key id)
{
string strOn = "OFF"; if (on) strOn = "ON";
string strLinkSet = "REGION"; if (linkSet) strLinkSet = "LINKSET";
string strFullbright = "NO"; if (fullbright) strFullbright = "YES";
string strButton = "On/Off"; if (particleMenu) strButton = "Particles";
else if (notecardMenu) strButton = "Presets";
else if (extButton) strButton = extButton;
menuChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(menuHandle);
menuHandle = llListen(menuChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, title + " " + version +
"\n\nIntensity: " + (string)perIntensity + "%\t\tState: " + strOn +
"\nRadius: " + (string)perRadius + "%\t\tFullbright: " + strFullbright +
"\nFalloff: " + (string)perFalloff + "%\t\tMode: " + strLinkSet +
"\nGlow: " + (string)perGlow + "%\t\tGroup: " + getGroup(), [
"-Glow", "+Glow", strButton,
"-Falloff", "+Falloff", "Reset",
"-Radius", "+Radius", "Fullbright",
"-Intensity", "+Intensity", "Color" ],
menuChannel);
}
colorDialog (key id)
{
colorChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(colorHandle);
colorHandle = llListen(colorChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
if (on) {
llDialog(id, "Color & Alpha when ON" +
"\n\nRed: " + (string)perRed + "%" +
"\nGreen: " + (string)perGreen + "%" +
"\nBlue: " + (string)perBlue + "%" +
"\nAlpha: " + (string)perAlpha + "%", [
"-Alpha", "+Alpha", "Main menu",
"-Blue", "+Blue", "B min/max",
"-Green", "+Green", "G min/max",
"-Red", "+Red", "R min/max" ],
colorChannel);
}
else {
llDialog(id, "Color & Alpha when OFF" +
"\n\nRed: " + (string)perRedOff + "%" +
"\nGreen: " + (string)perGreenOff + "%" +
"\nBlue: " + (string)perBlueOff + "%" +
"\nAlpha: " + (string)perAlphaOff + "%", [
"-Alpha", "+Alpha", "Main menu",
"-Blue", "+Blue", "B min/max",
"-Green", "+Green", "G min/max",
"-Red", "+Red", "R min/max" ],
colorChannel);
}
}
particleDialog (key id)
{
string strLightOn = "OFF"; if (on) strLightOn = "ON";
string strParticlesOn = "OFF"; if (particles) strParticlesOn = "ON";
particleChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(particleHandle);
particleHandle = llListen(particleChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, "Particle effect" +
"\n\nLight: " + strLightOn +
"\nParticles: " + strParticlesOn, [
"Min", "Max", "Main menu",
"-10%", "+10%", "Reset",
"-5%", "+5%", "Part. on/off",
"-1%", "+1%", "Light on/off" ],
particleChannel);
}
notecardDialog (key id)
{
string name = llGetSubString(notecard, llStringLength(configPrefix) + llStringLength(configSeparator), -1);
notecardChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(notecardHandle);
notecardHandle = llListen(notecardChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(300);
llDialog(id, "Configuration notecards\n\nLoaded notecard: " + name, notecardButtons, notecardChannel);
}
string getGroup()
{
if (!lightGroups) return "None";
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
float percentage (integer per, float num)
{
return num / 100.0 * (float)per;
}
integer min (integer x, integer y)
{
if (x < y) return x; else return y;
}
integer max (integer x, integer y)
{
if (x > y) return x; else return y;
}
reset()
{
perRed = (integer)defColor.x;
perGreen = (integer)defColor.y;
perBlue = (integer)defColor.z;
perRedOff = (integer)defColorOff.x;
perGreenOff = (integer)defColorOff.y;
perBlueOff = (integer)defColorOff.z;
perAlpha = defAlpha;
perAlphaOff = defAlphaOff;
perIntensity = defIntensity;
perRadius = defRadius;
perFalloff = defFalloff;
perGlow = defGlow;
fullbright = defFullbright;
}
sendMessage(string group)
{
vector color;
vector colorOn;
vector colorOff;
float intensity;
float radius;
float falloff;
float alpha;
float glow;
integer fullbr;
vector primColor;
vector particleColor;
integer particlesOn;
colorOn.x = percentage(perRed, maxRed);
colorOn.y = percentage(perGreen, maxGreen);
colorOn.z = percentage(perBlue, maxBlue);
colorOff.x = percentage(perRedOff, maxRed);
colorOff.y = percentage(perGreenOff, maxGreen);
colorOff.z = percentage(perBlueOff, maxBlue);
if (on) {
color = colorOn;
intensity = percentage(perIntensity, (float)baseIntensity / 100.0);
radius = percentage(perRadius, maxRadius);
falloff = percentage(perFalloff, maxFalloff);
alpha = percentage(perAlpha, maxAlpha);
glow = percentage(perGlow, maxGlow);
fullbr = fullbright;
if (changePrimColor) primColor = color;
else primColor = colorOff;
if (changeParticleColor) particleColor = color;
else particleColor = colorOff;
particlesOn = particles;
}
else {
color = colorOff;
alpha = percentage(perAlphaOff, maxAlpha);
glow = 0.0;
fullbr = FALSE;
primColor = color;
particlesOn = FALSE;
}
list msgList = [group, on, color, intensity, radius, falloff, alpha, glow, fullbr,
primColor, particleColor, defParticleSize, particleInc, particleTexture, particlesOn,
"<" + faces + ">", lightGroups];
string msg = llList2CSV(msgList);
particleInc = 0;
if (linkSet) llMessageLinked(LINK_SET, switchChannel, msg, "");
else llRegionSay(switchChannel, msg);
}
default
{
state_entry()
{
owner = llGetOwner();
notecard = configPrefix + configSeparator + defNotecard;
discoverNotecards();
loadNotecard();
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
llResetTime();
}
touch_end(integer total_number)
{
if (loading) {
llWhisper(0, "Notecard is still loading");
return;
}
user = llDetectedKey(0);
if (llGetTime() > 1.0) {
if (accessGranted(user, menuAccess)) menuDialog(user);
else llInstantMessage(user, "[Menu] Access denied");
}
else {
if (accessGranted(user, switchAccess)) {
on = !on;
sendMessage(getGroup());
}
else llInstantMessage(user, "[Switch] Access denied");
}
}
listen(integer channel, string name, key id, string msg)
{
llSetTimerEvent(0);
if (channel == menuChannel) {
llListenRemove(menuHandle);
if (msg == "-Intensity") perIntensity = max(perIntensity - percent, 0);
else if (msg == "-Radius") perRadius = max(perRadius - percent, 0);
else if (msg == "-Falloff") perFalloff = max(perFalloff - percent, 0);
else if (msg == "-Glow") perGlow = max(perGlow - percent, 0);
else if (msg == "+Intensity") perIntensity = min(perIntensity + percent, 100);
else if (msg == "+Radius") perRadius = min(perRadius + percent, 100);
else if (msg == "+Falloff") perFalloff = min(perFalloff + percent, 100);
else if (msg == "+Glow") perGlow = min(perGlow + percent, 100);
else if (msg == "Color") colorDialog(id);
else if (msg == "Fullbright") fullbright = !fullbright;
else if (msg == "Reset") reset();
else if (msg == "On/Off") on = !on;
else if (msg == "Particles") particleDialog(id);
else if (msg == "Presets") {
if (llGetListLength(notecardButtons) > 0) notecardDialog(id);
else llWhisper(0, "No configuration notecards found");
}
else if (msg == extButton) llMessageLinked(LINK_SET, extNumber, msg, id);
if (msg != "Color" && msg != "Particles" && msg != "Presets" && msg != extButton) {
sendMessage(getGroup());
menuDialog(id);
}
}
else if (channel == colorChannel) {
llListenRemove(colorHandle);
if (on) {
if (msg == "-Red") perRed = max(perRed - percent, 0);
else if (msg == "-Green") perGreen = max(perGreen - percent, 0);
else if (msg == "-Blue") perBlue = max(perBlue - percent, 0);
else if (msg == "-Alpha") perAlpha = max(perAlpha - percent, 0);
else if (msg == "+Red") perRed = min(perRed + percent, 100);
else if (msg == "+Green") perGreen = min(perGreen + percent, 100);
else if (msg == "+Blue") perBlue = min(perBlue + percent, 100);
else if (msg == "+Alpha") perAlpha = min(perAlpha + percent, 100);
else if (msg == "R min/max") { if (perRed) perRed = 0; else perRed = 100; }
else if (msg == "G min/max") { if (perGreen) perGreen = 0; else perGreen = 100; }
else if (msg == "B min/max") { if (perBlue) perBlue = 0; else perBlue = 100; }
else if (msg == "Main menu") menuDialog(id);
}
else {
if (msg == "-Red") perRedOff = max(perRedOff - percent, 0);
else if (msg == "-Green") perGreenOff = max(perGreenOff - percent, 0);
else if (msg == "-Blue") perBlueOff = max(perBlueOff - percent, 0);
else if (msg == "-Alpha") perAlphaOff = max(perAlphaOff - percent, 0);
else if (msg == "+Red") perRedOff = min(perRedOff + percent, 100);
else if (msg == "+Green") perGreenOff = min(perGreenOff + percent, 100);
else if (msg == "+Blue") perBlueOff = min(perBlueOff + percent, 100);
else if (msg == "+Alpha") perAlphaOff = min(perAlphaOff + percent, 100);
else if (msg == "R min/max") { if (perRedOff) perRedOff = 0; else perRedOff = 100; }
else if (msg == "G min/max") { if (perGreenOff) perGreenOff = 0; else perGreenOff = 100; }
else if (msg == "B min/max") { if (perBlueOff) perBlueOff = 0; else perBlueOff = 100; }
else if (msg == "Main menu") menuDialog(id);
}
if (msg != "Main menu") {
sendMessage(getGroup());
colorDialog(id);
}
}
else if (channel == particleChannel) {
llListenRemove(particleHandle);
if (msg == "-1%") particleInc = -1;
else if (msg == "+1%") particleInc = 1;
else if (msg == "-5%") particleInc = -5;
else if (msg == "+5%") particleInc = 5;
else if (msg == "-10%") particleInc = -10;
else if (msg == "+10%") particleInc = 10;
else if (msg == "Min") particleInc = -100;
else if (msg == "Max") particleInc = 100;
else if (msg == "Light on/off") on = !on;
else if (msg == "Part. on/off") particles = !particles;
else if (msg == "Reset") particleInc = 999; // reset particle size
else if (msg == "Main menu") menuDialog(id);
if (msg != "Main menu") {
sendMessage(getGroup());
particleDialog(id);
}
}
else if (channel == notecardChannel) {
llListenRemove(notecardHandle);
if (msg == "Main menu") menuDialog(id);
else {
notecard = configPrefix + configSeparator + msg;
loadNotecard();
}
}
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != msgNumber) return;
if (loading) {
llWhisper(0, "Notecard is still loading");
return;
}
if (id) user = id;
else {
llWhisper(0, "A valid avatar key must be provided in the link message");
return;
}
if (msg == msgSwitch) {
if (accessGranted(id, switchAccess)) {
on = !on;
sendMessage(getGroup());
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgOn) {
if (accessGranted(id, switchAccess)) {
if (!on) {
on = TRUE;
sendMessage(getGroup());
}
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgOff) {
if (accessGranted(id, switchAccess)) {
if (on) {
on = FALSE;
sendMessage(getGroup());
}
}
else llInstantMessage(id, "[Switch] Access denied");
}
else if (msg == msgMenu) {
if (accessGranted(id, menuAccess)) menuDialog(id);
else llInstantMessage(id, "[Menu] Access denied");
}
}
dataserver(key req, string data)
{
if (data == EOF) {
defColor.x = checkInt("ColorOn (RED)", (integer)defColor.x, 0, 100);
defColor.y = checkInt("ColorOn (GREEN)", (integer)defColor.y, 0, 100);
defColor.z = checkInt("ColorOn (BLUE)", (integer)defColor.z, 0, 100);
defColorOff.x = checkInt("ColorOff (RED)", (integer)defColorOff.x, 0, 100);
defColorOff.y = checkInt("ColorOff (GREEN)", (integer)defColorOff.y, 0, 100);
defColorOff.z = checkInt("ColorOff (BLUE)", (integer)defColorOff.z, 0, 100);
reset();
particleInc = 999; // reset particle size in plugin script
sendMessage(getGroup());
if (verbose) if (user) {} else {
llWhisper(0, "Touch to turn light on or off");
llWhisper(0, "Long touch to show menu");
if (linkSet) llWhisper(0, title + " " + version + "-LINKSET ready");
else llWhisper(0, title + " " + version + "-REGION ready");
}
loading = FALSE;
llSetText("", ZERO_VECTOR, 0.0);
if (user) notecardDialog(user);
}
else {
readNotecard(data);
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) {
user = "";
discoverNotecards();
loadNotecard();
}
}
timer()
{
llSetTimerEvent(0);
llListenRemove(menuHandle);
llListenRemove(colorHandle);
llListenRemove(particleHandle);
llListenRemove(notecardHandle);
}
}

View File

@@ -1,138 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:37:37
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1770
// :REV:1.0.1
// :WORLD:Opensim
// :DESCRIPTION:
// Configuration Control: Menu-controlled lighting system with many features
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Configuration Control
//
// Author: Rene10957 Resident
// Date: 24-08-2014
//
// Drop this in every light bulb, instead of the light script
// Make sure the switch is in a separate prim (not root)
// Remove after use
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
//////////////////////////////////////////
// Please read user manual before using //
//////////////////////////////////////////
string title = "Configuration Control"; // title
string version = "1.0.1."; // version
// Constants
integer pluginChannel = 10957; // plugin channel
integer switchChannel = -10957; // switch channel
// Variables
list onList;
list offList;
vector color;
vector primColor;
string intensity;
string radius;
string falloff;
string alpha;
string glow;
string fullbright;
string red;
string green;
string blue;
string primRed;
string primGreen;
string primBlue;
// Functions
string roundDecimals(float number, float decimals)
{
integer intNumber = llRound(number * llPow(10, decimals)); // move decimal point to the right and round
float fltNumber = (float)intNumber / llPow(10, decimals); // move it back to the left
string strNumber = (string)fltNumber; // cast to string
string end = llGetSubString(strNumber, -1, -1);
while (end == "0") { // remove trailing zeroes
strNumber = llDeleteSubString(strNumber, -1, -1);
end = llGetSubString(strNumber, -1, -1);
}
if (end == ".") {
return llGetSubString(strNumber, 0, -2);
}
else {
if (llGetSubString(strNumber, 0, 0) == "0") return llGetSubString(strNumber, 1, -1);
else return strNumber;
}
}
storeData(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 1);
color = (vector)llList2String(msgList, 2);
intensity = roundDecimals((float)llList2String(msgList, 3), 2);
radius = roundDecimals((float)llList2String(msgList, 4), 2);
falloff = roundDecimals((float)llList2String(msgList, 5), 2);
alpha = roundDecimals((float)llList2String(msgList, 6), 2);
glow = roundDecimals((float)llList2String(msgList, 7), 2);
fullbright = llList2String(msgList, 8);
primColor = (vector)llList2String(msgList, 9);
red = roundDecimals(color.x, 2);
green = roundDecimals(color.y, 2);
blue = roundDecimals(color.z, 2);
primRed = roundDecimals(primColor.x, 2);
primGreen = roundDecimals(primColor.y, 2);
primBlue = roundDecimals(primColor.z, 2);
llSetPrimitiveParams([
PRIM_POINT_LIGHT, on, color, (float)intensity, (float)radius, (float)falloff,
PRIM_COLOR, ALL_SIDES, primColor, (float)alpha,
PRIM_GLOW, ALL_SIDES, (float)glow,
PRIM_FULLBRIGHT, ALL_SIDES, (integer)fullbright]);
if (on) onList = [red, green, blue, intensity, radius, falloff, alpha, glow, fullbright,
primRed, primGreen, primBlue];
else offList = [red, green, blue, alpha];
if (llGetListLength(onList) > 0 && llGetListLength(offList) > 0) {
string desc = llDumpList2String(["#LS#"] + onList + offList, ";");
llSetObjectDesc(desc);
}
}
default
{
state_entry()
{
if (llGetSubString(llGetObjectDesc(), 0, 3) == "#LS#") llSetObjectDesc("(No Description)");
llMessageLinked(LINK_ALL_OTHERS, pluginChannel, "off", llGetOwner()); // request information from switch
llWhisper(0, title + " " + version + " ready");
llOwnerSay("Please remove the script after use");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == switchChannel) storeData(msg);
}
}

View File

@@ -1,162 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:38:41
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1770
// :REV:1.0.1
// :WORLD:Opensim
// :DESCRIPTION:
// Extended Configuration Control
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Extended Configuration Control
//
// Author: Rene10957 Resident
// Date: 24-08-2014
//
// Drop this in a separate prim (not root) together with the switch
// Remove after use
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
//////////////////////////////////////////
// Please read user manual before using //
//////////////////////////////////////////
string title = "Extended Configuration Control"; // title
string version = "1.0.1"; // version
// Constants
integer pluginChannel = 10957; // plugin channel
integer switchChannel = -10957; // switch channel
// Variables
list onList;
list offList;
vector color;
vector primColor;
vector particleColor;
string intensity;
string radius;
string falloff;
string alpha;
string glow;
string fullbright;
string particleSize;
string particleTexture;
string red;
string green;
string blue;
string primRed;
string primGreen;
string primBlue;
string partRed;
string partGreen;
string partBlue;
// Functions
string roundDecimals(float number, float decimals)
{
integer intNumber = llRound(number * llPow(10, decimals)); // move decimal point to the right and round
float fltNumber = (float)intNumber / llPow(10, decimals); // move it back to the left
string strNumber = (string)fltNumber; // cast to string
string end = llGetSubString(strNumber, -1, -1);
while (end == "0") { // remove trailing zeroes
strNumber = llDeleteSubString(strNumber, -1, -1);
end = llGetSubString(strNumber, -1, -1);
}
if (end == ".") {
return llGetSubString(strNumber, 0, -2);
}
else {
if (llGetSubString(strNumber, 0, 0) == "0") return llGetSubString(strNumber, 1, -1);
else return strNumber;
}
}
storeData(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 1);
color = (vector)llList2String(msgList, 2);
intensity = roundDecimals((float)llList2String(msgList, 3), 2);
radius = roundDecimals((float)llList2String(msgList, 4), 2);
falloff = roundDecimals((float)llList2String(msgList, 5), 2);
alpha = roundDecimals((float)llList2String(msgList, 6), 2);
glow = roundDecimals((float)llList2String(msgList, 7), 2);
fullbright = llList2String(msgList, 8);
primColor = (vector)llList2String(msgList, 9);
particleColor = (vector)llList2String(msgList, 10);
particleSize = llList2String(msgList, 11);
particleTexture = llList2String(msgList, 13);
red = roundDecimals(color.x, 2);
green = roundDecimals(color.y, 2);
blue = roundDecimals(color.z, 2);
primRed = roundDecimals(primColor.x, 2);
primGreen = roundDecimals(primColor.y, 2);
primBlue = roundDecimals(primColor.z, 2);
partRed = roundDecimals(particleColor.x, 2);
partGreen = roundDecimals(particleColor.y, 2);
partBlue = roundDecimals(particleColor.z, 2);
// Since the description differs from other prims, switch-to-light communication will fail.
// Solution: fake the switch message and pretend this is the default group.
list sendList = ["Default", on, color, intensity, radius, falloff, alpha, glow, fullbright,
primColor, particleColor, particleSize, 999, particleTexture, on];
string sendMsg = llList2CSV(sendList);
llMessageLinked(LINK_ALL_OTHERS, switchChannel, sendMsg, "");
if (on) onList = [red, green, blue, intensity, radius, falloff, alpha, glow, fullbright,
primRed, primGreen, primBlue, partRed, partGreen, partBlue, particleSize, particleTexture];
else offList = [red, green, blue, alpha];
if (llGetListLength(onList) > 0 && llGetListLength(offList) > 0) {
string desc = llDumpList2String(["#LS#"] + onList + offList, ";");
llSetObjectDesc(desc);
}
}
default
{
state_entry()
{
integer i;
integer number = llGetNumberOfPrims();
list descList;
string desc;
for (i = number; i >= 0; --i) {
descList = llGetLinkPrimitiveParams(i, [PRIM_DESC]);
desc = llList2String(descList, 0);
if (llGetSubString(desc, 0, 3) == "#LS#") llSetLinkPrimitiveParamsFast(i, [PRIM_DESC,"(No Description)"]);
}
llMessageLinked(LINK_THIS, pluginChannel, "off", llGetOwner()); // request information from switch
llWhisper(0, title + " " + version + " ready");
llOwnerSay("Please remove the script after use");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == switchChannel) storeData(msg);
}
}

View File

@@ -1,117 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:39:48
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1770
// :REV:1.0
// :WORLD:Opensim
// :DESCRIPTION:
// Drop in any prim and touch for on/off
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Extended Switch Control
//
// Author: Rene10957 Resident
// Date: 21-03-2014
//
// Drop in any prim and touch for on/off
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
//////////////////////////////////////////
// Please read user manual before using //
//////////////////////////////////////////
string title = "Extended Switch Control"; // title
string version = "1.0"; // version
integer silent = TRUE; // silent startup
// Constants
integer switchChannel = -10957; // switch channel
// Variables
integer on = FALSE; // on-off switch
// Functions
switchLight()
{
vector color;
vector primColor;
vector particleColor;
float intensity;
float radius;
float falloff;
float alpha;
float glow;
integer fullbright;
integer particleSize;
string particleTexture;
string desc = llGetObjectDesc();
if (llGetSubString(desc, 0, 3) == "#LS#") {
list configList = llParseStringKeepNulls(desc, [";"], []);
if (on) {
color.x = (float)llList2String(configList, 1);
color.y = (float)llList2String(configList, 2);
color.z = (float)llList2String(configList, 3);
intensity = (float)llList2String(configList, 4);
radius = (float)llList2String(configList, 5);
falloff = (float)llList2String(configList, 6);
alpha = (float)llList2String(configList, 7);
glow = (float)llList2String(configList, 8);
fullbright = (integer)llList2String(configList, 9);
primColor.x = (float)llList2String(configList, 10);
primColor.y = (float)llList2String(configList, 11);
primColor.z = (float)llList2String(configList, 12);
particleColor.x = (float)llList2String(configList, 13);
particleColor.y = (float)llList2String(configList, 14);
particleColor.z = (float)llList2String(configList, 15);
particleSize = (integer)llList2String(configList, 16);
particleTexture = llList2String(configList, 17);
}
else {
color.x = (float)llList2String(configList, 18);
color.y = (float)llList2String(configList, 19);
color.z = (float)llList2String(configList, 20);
alpha = (float)llList2String(configList, 21);
glow = 0.0;
fullbright = FALSE;
primColor = color;
}
list sendList = ["Default", on, color, intensity, radius, falloff, alpha, glow, fullbright,
primColor, particleColor, particleSize, 999, particleTexture, on];
string sendMsg = llList2CSV(sendList);
llMessageLinked(LINK_ALL_OTHERS, switchChannel, sendMsg, "");
}
}
default
{
state_entry()
{
switchLight();
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
on = !on;
switchLight();
}
}

View File

@@ -1,98 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:08
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1771
// :REV:1.1
// :WORLD:Opensim
// :DESCRIPTION:
// Light Control (light without bulbs)
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Light Control (light without bulbs)
//
// Author: Rene10957 Resident
// Date: 21-03-2014
//
// Use together with switch and drop in the same prim
// No other scripts are needed
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
//////////////////////////////////////////
// Please read user manual before using //
//////////////////////////////////////////
string title = "Light Control"; // title
string version = "1.1"; // version
integer silent = TRUE; // silent startup
// Constants
integer switchChannel = -10957; // switch channel
// Functions
string getGroup(integer link)
{
list desc = llGetLinkPrimitiveParams(link, [PRIM_DESC]);
string str = llToLower(llStringTrim(llList2String(desc, 0), STRING_TRIM));
if (str == "(no description)" || str == "") str = "default";
return str;
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
string group = llToLower(llList2String(msgList, 0));
integer on = (integer)llList2String(msgList, 1);
vector color = (vector)llList2String(msgList, 2);
float intensity = (float)llList2String(msgList, 3);
float radius = (float)llList2String(msgList, 4);
float falloff = (float)llList2String(msgList, 5);
float alpha = (float)llList2String(msgList, 6);
float glow = (float)llList2String(msgList, 7);
integer fullbright = (integer)llList2String(msgList, 8);
vector primColor = (vector)llList2String(msgList, 9);
integer i;
integer number = llGetNumberOfPrims();
integer link = llGetLinkNumber();
for (i = number; i >= 0; --i) {
if (group == getGroup(i)) {
if (i != link || i < 2) {
llSetLinkPrimitiveParamsFast(i, [
PRIM_POINT_LIGHT, on, color, intensity, radius, falloff,
PRIM_COLOR, ALL_SIDES, primColor, alpha,
PRIM_GLOW, ALL_SIDES, glow,
PRIM_FULLBRIGHT, ALL_SIDES, fullbright]);
}
}
}
}
default
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == switchChannel) unpackMessage(msg);
}
}

View File

@@ -1,76 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:18
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1772
// :REV:1.2
// :WORLD:Opensim
// :DESCRIPTION:
// Link control (secondary switch)
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Link control (secondary switch) for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 24-01-2014
//
// Drop this in any prim (within the same linkset) you want to use as an extra on/off/menu switch
// Note: only useful if you need multiple switches for the same light group in LINKSET mode
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Link Control"; // title
string version = "1.2"; // version
integer silent = TRUE; // silent startup
// Constants
integer msgNumber = -975104; // number part of link message
string separator = ";;"; // separator for link messages
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
llResetTime();
}
touch_end(integer total_number)
{
key user = llDetectedKey(0);
string command;
if (llGetTime() > 1.0) command = "menu";
else command = "switch";
list msgList = [getGroup(), command, user];
string msgData = llDumpList2String(msgList, separator);
llMessageLinked(LINK_ALL_OTHERS, msgNumber, msgData, "");
}
}

View File

@@ -1,71 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:20
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1773
// :REV:1.2
// :WORLD:Opensim
// :DESCRIPTION:
// Link receiver for Rene's Free Lighting System
// :CODE:
// :LICENSE: CC0 (Public Domain)
//
// Author: Rene10957 Resident
// Date: 24-01-2014
//
// Drop this into the same prim where the SWITCH is located
// Note: only useful if you are also using the link control script
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Link Receiver"; // title
string version = "1.2"; // version
integer silent = TRUE; // silent startup
// Constants
integer msgIn = -975104; // number part of incoming link message
integer msgOut = 10957; // number part of outgoing link message
string separator = ";;"; // separator for link messages
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != msgIn) return;
list msgList = llParseString2List(msg, [separator], []);
string group = llList2String(msgList, 0);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
if (llToLower(group) == llToLower(getGroup())) llMessageLinked(LINK_THIS, msgOut, command, user);
}
}

View File

@@ -1,188 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:21
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1774
// :REV:2.3.2
// :WORLD:Opensim
// :DESCRIPTION:
// Drop this in any prim you want to use as a control panel
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Network control for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 05-10-2014
//
// Drop this in any prim you want to use as a control panel
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Network Control"; // title
string version = "2.3.2"; // version
integer linkSet = TRUE; // LINKSET mode
integer silent = TRUE; // silent startup
// Constants
float cDialogTime = 120.0; // dialog timeout = 2 minutes
float cReplyTime = 1.0; // reply timeout = 1 second
integer remoteChannel = -975103; // remote channel (send)
integer replyChannel = -975105; // reply channel (receive)
string separator = ";;"; // separator for link or region messages
// Variables
float time; // timer interval for multiple timers
float vReplyTime; // variable timeout for node discovery, ranging from 1 to 2 sec.
integer dialogChannel; // dialog channel
integer dialogHandle; // handle for dialog listener
integer replyHandle; // handle for reply listener
key owner; // object owner
key user; // key of last avatar to touch object
list networkNodes; // strided list of network nodes (object key, object name)
list menuButtons; // menu buttons (object names)
// Functions
list orderButtons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7);
}
float setTimer(float sec)
{
llSetTimerEvent(0.0);
llSetTimerEvent(sec);
return sec;
}
discoverNodes(key id)
{
llWhisper(0, "Discovering network nodes...");
networkNodes = [];
llListenRemove(replyHandle);
replyHandle = llListen(replyChannel, "", "", "");
float pctlag = 100.0 * (1.0 - llGetRegionTimeDilation()); // try to work around time dilation
vReplyTime = cReplyTime + cReplyTime / 100.0 * pctlag; // (more lag = longer timeout)
time = setTimer(vReplyTime);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, "PING", llGetKey());
else llRegionSay(remoteChannel, "PING");
}
menuDialog (key id)
{
dialogChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(dialogHandle);
dialogHandle = llListen(dialogChannel, "", "", "");
time = setTimer(cDialogTime);
llDialog(id, title + " " + version, menuButtons, dialogChannel);
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) version += "-LINKSET";
else version += "-REGION";
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
user = llDetectedKey(0);
if (llGetListLength(networkNodes) == 0) discoverNodes(user);
else menuDialog(user);
}
listen(integer channel, string name, key id, string msg)
{
integer length = llGetListLength(networkNodes) / 2;
if (channel == replyChannel) {
if (llGetOwnerKey(id) != owner) return;
if (length > 8) return;
string shortName = llGetSubString(msg, 0, 23);
networkNodes += [id, shortName];
}
else if (channel == dialogChannel) {
llSetTimerEvent(0);
llListenRemove(dialogHandle);
integer i;
integer index;
key target;
list msgList;
string msgData;
if (msg == "On") {
for (i = 0; i < length; ++i) {
target = llList2Key(networkNodes, i * 2);
msgList = [target, "on", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
menuDialog(id);
}
else if (msg == "Off") {
for (i = 0; i < length; ++i) {
target = llList2Key(networkNodes, i * 2);
msgList = [target, "off", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
menuDialog(id);
}
else if (msg == "Discover") {
discoverNodes(id);
}
else {
index = llListFindList(networkNodes, [msg]);
if (index > -1) {
target = llList2Key(networkNodes, index - 1);
msgList = [target, "menu", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
else {
llInstantMessage(id, "Unexpected error during object key lookup");
menuDialog(id);
}
}
}
}
timer()
{
llSetTimerEvent(0);
if (time == cDialogTime) { // dialog timeout
llListenRemove(dialogHandle);
}
else if (time == vReplyTime) { // remote timeout (variable!)
integer length = llGetListLength(networkNodes) / 2;
if (length == 1) llWhisper(0, "Node discovery completed (" + (string)length + " node)");
else llWhisper(0, "Node discovery completed (" + (string)length + " nodes)");
llListenRemove(replyHandle);
if (length > 0) {
menuButtons = llList2ListStrided(networkNodes, 1, -1, 2);
menuButtons = llListSort(menuButtons, 1, TRUE); // sort ascending
menuButtons = orderButtons(menuButtons); // reverse row order
menuButtons = ["On", "Off", "Discover"] + menuButtons;
if (user) menuDialog(user);
}
}
}
}

View File

@@ -1,188 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:22
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1775
// :REV:2.3.2
// :WORLD:Opensim
// :DESCRIPTION:
// Drop this in any prim you want to use as a control panel
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Network control for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 05-10-2014
//
// Drop this in any prim you want to use as a control panel
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Network Control"; // title
string version = "2.3.2"; // version
integer linkSet = FALSE; // REGION mode
integer silent = TRUE; // silent startup
// Constants
float cDialogTime = 120.0; // dialog timeout = 2 minutes
float cReplyTime = 1.0; // reply timeout = 1 second
integer remoteChannel = -975103; // remote channel (send)
integer replyChannel = -975105; // reply channel (receive)
string separator = ";;"; // separator for link or region messages
// Variables
float time; // timer interval for multiple timers
float vReplyTime; // variable timeout for node discovery, ranging from 1 to 2 sec.
integer dialogChannel; // dialog channel
integer dialogHandle; // handle for dialog listener
integer replyHandle; // handle for reply listener
key owner; // object owner
key user; // key of last avatar to touch object
list networkNodes; // strided list of network nodes (object key, object name)
list menuButtons; // menu buttons (object names)
// Functions
list orderButtons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7);
}
float setTimer(float sec)
{
llSetTimerEvent(0.0);
llSetTimerEvent(sec);
return sec;
}
discoverNodes(key id)
{
llWhisper(0, "Discovering network nodes...");
networkNodes = [];
llListenRemove(replyHandle);
replyHandle = llListen(replyChannel, "", "", "");
float pctlag = 100.0 * (1.0 - llGetRegionTimeDilation()); // try to work around time dilation
vReplyTime = cReplyTime + cReplyTime / 100.0 * pctlag; // (more lag = longer timeout)
time = setTimer(vReplyTime);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, "PING", llGetKey());
else llRegionSay(remoteChannel, "PING");
}
menuDialog (key id)
{
dialogChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(dialogHandle);
dialogHandle = llListen(dialogChannel, "", "", "");
time = setTimer(cDialogTime);
llDialog(id, title + " " + version, menuButtons, dialogChannel);
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) version += "-LINKSET";
else version += "-REGION";
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
user = llDetectedKey(0);
if (llGetListLength(networkNodes) == 0) discoverNodes(user);
else menuDialog(user);
}
listen(integer channel, string name, key id, string msg)
{
integer length = llGetListLength(networkNodes) / 2;
if (channel == replyChannel) {
if (llGetOwnerKey(id) != owner) return;
if (length > 8) return;
string shortName = llGetSubString(msg, 0, 23);
networkNodes += [id, shortName];
}
else if (channel == dialogChannel) {
llSetTimerEvent(0);
llListenRemove(dialogHandle);
integer i;
integer index;
key target;
list msgList;
string msgData;
if (msg == "On") {
for (i = 0; i < length; ++i) {
target = llList2Key(networkNodes, i * 2);
msgList = [target, "on", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
menuDialog(id);
}
else if (msg == "Off") {
for (i = 0; i < length; ++i) {
target = llList2Key(networkNodes, i * 2);
msgList = [target, "off", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
menuDialog(id);
}
else if (msg == "Discover") {
discoverNodes(id);
}
else {
index = llListFindList(networkNodes, [msg]);
if (index > -1) {
target = llList2Key(networkNodes, index - 1);
msgList = [target, "menu", id]; // id = user who opened the dialog
msgData = llDumpList2String(msgList, separator);
if (linkSet) llMessageLinked(LINK_ALL_OTHERS, remoteChannel, msgData, "");
else llRegionSayTo(target, remoteChannel, msgData);
}
else {
llInstantMessage(id, "Unexpected error during object key lookup");
menuDialog(id);
}
}
}
}
timer()
{
llSetTimerEvent(0);
if (time == cDialogTime) { // dialog timeout
llListenRemove(dialogHandle);
}
else if (time == vReplyTime) { // remote timeout (variable!)
integer length = llGetListLength(networkNodes) / 2;
if (length == 1) llWhisper(0, "Node discovery completed (" + (string)length + " node)");
else llWhisper(0, "Node discovery completed (" + (string)length + " nodes)");
llListenRemove(replyHandle);
if (length > 0) {
menuButtons = llList2ListStrided(networkNodes, 1, -1, 2);
menuButtons = llListSort(menuButtons, 1, TRUE); // sort ascending
menuButtons = orderButtons(menuButtons); // reverse row order
menuButtons = ["On", "Off", "Discover"] + menuButtons;
if (user) menuDialog(user);
}
}
}
}

View File

@@ -1,100 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:24
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1776
// :REV:2.2.1
// :WORLD:Opensim
// :DESCRIPTION:
// Drop this into the same prim where the SWITCH is located
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Network receiver for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 05-10-2014
//
// Drop this into the same prim where the SWITCH is located
// Note: only useful if you are also using the network control script
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Network Receiver"; // title
string version = "2.2.1"; // version
integer linkSet = TRUE; // LINKSET mode
integer silent = TRUE; // silent startup
// Constants
integer remoteChannel = -975103; // remote channel
integer replyChannel = -975105; // reply channel
integer msgNumber = 10957; // number part of link message
string separator = ";;"; // separator for link or region messages
// Variables
key owner; // object owner
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) {
version += "-LINKSET";
}
else {
version += "-REGION";
llListen(remoteChannel, "", "", "");
}
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != remoteChannel) return;
if (msg == "PING") {
llRegionSayTo(id, replyChannel, getGroup());
return;
}
list msgList = llParseString2List(msg, [separator], []);
key target = (key)llList2String(msgList, 0);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
if (target == llGetKey()) llMessageLinked(LINK_THIS, msgNumber, command, user);
}
listen(integer channel, string name, key id, string msg)
{
if (channel != remoteChannel) return;
if (llGetOwnerKey(id) != owner) return;
if (msg == "PING") {
llRegionSayTo(id, replyChannel, getGroup());
return;
}
list msgList = llParseString2List(msg, [separator], []);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
llMessageLinked(LINK_THIS, msgNumber, command, user);
}
}

View File

@@ -1,101 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:33
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1777
// :REV:2.2.1
// :WORLD:Opensim
// :DESCRIPTION:
// Drop this into the same prim where the SWITCH is located
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Network receiver for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 05-10-2014
//
// Drop this into the same prim where the SWITCH is located
// Note: only useful if you are also using the network control script
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Network Receiver"; // title
string version = "2.2.1"; // version
integer linkSet = FALSE; // REGION mode
integer silent = TRUE; // silent startup
// Constants
integer remoteChannel = -975103; // remote channel
integer replyChannel = -975105; // reply channel
integer msgNumber = 10957; // number part of link message
string separator = ";;"; // separator for link or region messages
// Variables
key owner; // object owner
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
owner = llGetOwner();
if (linkSet) {
version += "-LINKSET";
}
else {
version += "-REGION";
llListen(remoteChannel, "", "", "");
}
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number != remoteChannel) return;
if (msg == "PING") {
llRegionSayTo(id, replyChannel, getGroup());
return;
}
list msgList = llParseString2List(msg, [separator], []);
key target = (key)llList2String(msgList, 0);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
if (target == llGetKey()) llMessageLinked(LINK_THIS, msgNumber, command, user);
}
listen(integer channel, string name, key id, string msg)
{
if (channel != remoteChannel) return;
if (llGetOwnerKey(id) != owner) return;
if (msg == "PING") {
llRegionSayTo(id, replyChannel, getGroup());
return;
}
list msgList = llParseString2List(msg, [separator], []);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
llMessageLinked(LINK_THIS, msgNumber, command, user);
}
}

View File

@@ -1,75 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:35
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1778
// :REV:1.1
// :WORLD:Opensim
// :DESCRIPTION:
// Drop this in an external prim you want to use as an extra on/off/menu switch
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Remote control (secondary switch) for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 24-01-2014
//
// Drop this in an external prim you want to use as an extra on/off/menu switch
// Note: only useful if you need multiple switches for the same light group in REGION mode
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Remote Control"; // title
string version = "1.1"; // version
integer silent = TRUE; // silent startup
// Constants
integer remoteChannel = -975104; // remote channel
string separator = ";;"; // separator for region messages
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
llResetTime();
}
touch_end(integer total_number)
{
key user = llDetectedKey(0);
string command;
if (llGetTime() > 1.0) command = "menu";
else command = "switch";
list msgList = [getGroup(), command, user];
string msgData = llDumpList2String(msgList, separator);
llRegionSay(remoteChannel, msgData);
}
}

View File

@@ -1,71 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:37
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1779
// :REV:1.1
// :WORLD:Second Life
// :DESCRIPTION:
// Drop this into the same prim where the SWITCH is located
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Remote receiver for Rene's Free Lighting System
//
// Author: Rene10957 Resident
// Date: 24-01-2014
//
// Drop this into the same prim where the SWITCH is located
// Note: only useful if you are also using the remote control script
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
string title = "Remote Receiver"; // title
string version = "1.1"; // version
integer silent = TRUE; // silent startup
// Constants
integer remoteChannel = -975104; // remote channel
integer msgNumber = 10957; // number part of link message
string separator = ";;"; // separator for region messages
// Functions
string getGroup()
{
string str = llStringTrim(llGetObjectDesc(), STRING_TRIM);
if (llToLower(str) == "(no description)" || str == "") str = "Default";
return str;
}
default
{
state_entry()
{
llListen(remoteChannel, "", "", "");
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
listen(integer channel, string name, key id, string msg)
{
if (channel != remoteChannel) return;
list msgList = llParseString2List(msg, [separator], []);
string group = llList2String(msgList, 0);
string command = llList2String(msgList, 1);
key user = (key)llList2String(msgList, 2);
if (llToLower(group) == llToLower(getGroup())) llMessageLinked(LINK_THIS, msgNumber, command, user);
}
}

View File

@@ -1,115 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:39
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1780
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// Drop in any prim and touch for on/off
// :CODE:
// Each prim in a link set that has a Description of #LS# will become a light. This is the switch
//:LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Switch Control
//
// Drop in any prim and touch for on/off
// No switch or light scripts are needed
// License: CC0 (Public Domain).
// To the extent possible under law, Rene10957 has waived all copyright and related or neighboring rights.
// For more information, see http://creativecommons.org/publicdomain/zero/1.0/.
//////////////////////////////////////////
// Please read user manual before using //
//////////////////////////////////////////
string title = "Switch Control"; // title
string version = "1.0"; // version
integer silent = TRUE; // silent startup
// Variables
integer on = FALSE; // on-off switch
// Functions
switchLight()
{
string desc;
list descList;
list configList;
vector color;
vector primColor;
float intensity;
float radius;
float falloff;
float alpha;
float glow;
integer fullbright;
integer i;
integer number = llGetNumberOfPrims();
for (i = number; i >= 0; --i) {
descList = llGetLinkPrimitiveParams(i, [PRIM_DESC]);
desc = llList2String(descList, 0);
if (llGetSubString(desc, 0, 3) == "#LS#") {
configList = llParseStringKeepNulls(desc, [";"], []);
if (on) {
color.x = (float)llList2String(configList, 1);
color.y = (float)llList2String(configList, 2);
color.z = (float)llList2String(configList, 3);
intensity = (float)llList2String(configList, 4);
radius = (float)llList2String(configList, 5);
falloff = (float)llList2String(configList, 6);
alpha = (float)llList2String(configList, 7);
glow = (float)llList2String(configList, 8);
fullbright = (integer)llList2String(configList, 9);
primColor.x = (float)llList2String(configList, 10);
primColor.y = (float)llList2String(configList, 11);
primColor.z = (float)llList2String(configList, 12);
}
else {
color.x = (float)llList2String(configList, 13);
color.y = (float)llList2String(configList, 14);
color.z = (float)llList2String(configList, 15);
alpha = (float)llList2String(configList, 16);
glow = 0.0;
fullbright = FALSE;
primColor = color;
}
llSetLinkPrimitiveParamsFast(i, [
PRIM_POINT_LIGHT, on, color, intensity, radius, falloff,
PRIM_COLOR, ALL_SIDES, primColor, alpha,
PRIM_GLOW, ALL_SIDES, glow,
PRIM_FULLBRIGHT, ALL_SIDES, fullbright]);
}
}
}
default
{
state_entry()
{
switchLight();
if (!silent) llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
on = !on;
switchLight();
}
}

View File

@@ -1,188 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:58
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1791
// :REV:1.4
// :WORLD:Opensim
// :DESCRIPTION:
// Particle Plugin "Bling"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Bling"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Bling"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 2.0; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 0.3; // particle lifetime
float rate = 5.0; // particle burst rate
integer count = 1; // particle count
vector startScale = <0.2, 0.04, 0.0>; // particle start size
vector endScale = <0.0, 0.2, 0.0>; // particle end size
float minSpeed = 0.1; // particle min. burst speed
float maxSpeed = 0.1; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.5>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, color,
PSYS_PART_START_ALPHA, 1.0,
PSYS_PART_END_ALPHA, 1.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_BOUNCE_MASK |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK |
PSYS_PART_TARGET_POS_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,187 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:59
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1792
// :REV:1.4
// :WORLD:Opensim
// :DESCRIPTION:
// Particle Plugin "Candle flame dirty wick"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Candle flame dirty wick"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Candle flame dirty wick"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 0.4; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 0.01; // particle burst rate
integer count = 1; // particle count
vector startScale = <0.05, 0.1, 0.0>; // particle start size
vector endScale = <0.0, 0.0, 0.0>; // particle end size
float minSpeed = 0.02; // particle min. burst speed
float maxSpeed = 0.25; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, <1.0, 0.25, 0.0>,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_OMEGA, <0.02, 0.02, 2.0>,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,187 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:00
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1793
// :REV:1.4
// :WORLD:Opensim
// :DESCRIPTION:
// - Particle Plugin "Candle flame sensual"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Candle flame sensual"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Candle flame sensual"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 0.4; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 0.01; // particle burst rate
integer count = 1; // particle count
vector startScale = <0.05, 0.1, 0.0>; // particle start size
vector endScale = <0.0, 0.0, 0.0>; // particle end size
float minSpeed = 0.1; // particle min. burst speed
float maxSpeed = 0.1; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, <1.0, 0.25, 0.0>,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_OMEGA, <0.02, 0.02, 0.4>,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,188 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:01
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1794
// :REV:1
// :WORLD:Opensim
// :DESCRIPTION:
// - Particle Plugin "Candle flame simple"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Candle flame simple"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Candle flame simple"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 0.4; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 0.01; // particle burst rate
integer count = 1; // particle count
vector startScale = <0.05, 0.1, 0.0>; // particle start size
vector endScale = <0.0, 0.0, 0.0>; // particle end size
float minSpeed = 0.1; // particle min. burst speed
float maxSpeed = 0.1; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, <1.0, 0.25, 0.0>,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_OMEGA, <0.01, 0.01, 0.2>,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,184 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:02
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1795
// :REV:1
// :WORLD:Opensim
// :DESCRIPTION:
// - Particle Plugin "Fire"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Fire"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Fire"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 1.0; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 0.1; // particle burst rate
integer count = 10; // particle count
vector startScale = <0.1, 0.5, 0.0>; // particle start size
vector endScale = <0.1, 0.5, 0.0>; // particle end size
float minSpeed = 0.0; // particle min. burst speed
float maxSpeed = 0.01; // particle max. burst speed
float burstRadius = 0.1; // particle burst radius
vector partAccel = <0.0, 0.0, 2.5>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, <1.0, 0.0, 0.0>,
PSYS_PART_START_ALPHA, 1.0,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,186 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:03
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1796
// :REV:1
// :WORLD:Opensim
// :DESCRIPTION:
// - Particle Plugin "Halo"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Halo"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Halo"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 4.0; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.5; // particle lifetime
float rate = 0.05; // particle burst rate
integer count = 1; // particle count
vector startScale = <0.0, 0.0, 0.0>; // particle start size
vector endScale = <2.0, 2.0, 0.0>; // particle end size
float minSpeed = 0.0; // particle min. burst speed
float maxSpeed = 0.0; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_DROP,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, color,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,187 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:04
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1797
// :REV:1
// :WORLD:Opensim
// :DESCRIPTION:
// - Particle Plugin "Starbling"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Starbling"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Starbling"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 4.0; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 5.0; // particle burst rate
integer count = 25; // particle count
vector startScale = <0.1, 1.0, 0.0>; // particle start size
vector endScale = <0.1, 1.0, 0.0>; // particle end size
float minSpeed = 0.1; // particle min. burst speed
float maxSpeed = 0.1; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, color,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,187 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:42:06
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1798
// :REV:1.4
// :WORLD:Opensim
// :DESCRIPTION:
// Particle Plugin "Starburst"
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - Particle Plugin "Starburst"
//
// Author: Rene10957 Resident
// Date: 21-03-2014
////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the LIGHT is located //
////////////////////////////////////////////////////////////////////////////////
string title = "Particle Plugin"; // title
string name = "Starburst"; // name
string version = "1.4"; // version
integer silent = TRUE; // silent startup
// Constants
// Note: the official upper limit for particles is 4.0 meters but for more delicate particle effects
// it can be useful to set maxScale to a lower value, in order to achieve more fine-grained control.
integer particleChannel = -75901; // particle channel
integer feedbackChannel = -57910; // feedback channel
float minScale = 0.03125; // min. startScale or endScale
float maxScale = 4.0; // max. startScale or endScale
// Particle parameters
// Note: startScale and endScale are not actual sizes, but more like aspect ratios.
// The real size is determined by particleSize in the notecard, a percentage of maxScale.
float age = 1.0; // particle lifetime
float rate = 0.1; // particle burst rate
integer count = 5; // particle count
vector startScale = <0.1, 1.0, 0.0>; // particle start size
vector endScale = <0.1, 1.0, 0.0>; // particle end size
float minSpeed = 0.1; // particle min. burst speed
float maxSpeed = 0.1; // particle max. burst speed
float burstRadius = 0.0; // particle burst radius
vector partAccel = <0.0, 0.0, 0.0>; // particle accelleration
// Variables
float particleSize; // particle size (percentage)
float defParticleSize; // default particle size (percentage)
float minParticleSize; // minimum particle size (percentage)
// Functions
startParticles(vector color, vector start, vector end, float min, float max, float radius, vector push, string txtr)
{
llParticleSystem([
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, color,
PSYS_PART_END_COLOR, color,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.0,
PSYS_PART_START_SCALE, start,
PSYS_PART_END_SCALE, end,
PSYS_PART_MAX_AGE, age,
PSYS_SRC_BURST_RATE, rate,
PSYS_SRC_BURST_PART_COUNT, count,
PSYS_SRC_BURST_SPEED_MIN, min,
PSYS_SRC_BURST_SPEED_MAX, max,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_ACCEL, push,
PSYS_SRC_TEXTURE, txtr,
PSYS_PART_FLAGS,
0 |
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_SRC_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_INTERP_COLOR_MASK |
PSYS_PART_INTERP_SCALE_MASK ]);
}
/////////////////////////////////////////////////////////////////
// From this point onwards, every particle script is identical //
/////////////////////////////////////////////////////////////////
// Particle size = largest dimension across both scale vectors
float getParticleSize (vector start, vector end)
{
float max = 0.0;
if (start.x > max) max = start.x;
if (start.y > max) max = start.y;
if (end.x > max) max = end.x;
if (end.y > max) max = end.y;
return max / (maxScale / 100.0);
}
// Particle size is too small if both start.x and end.x < minScale (0.03125), or...
// both start.y and end.y < minScale (0.03125)
float getMinSize (vector start, vector end, float size)
{
float maxX = 0.0;
float maxY = 0.0;
float minXY = 0.0;
if (start.x < minScale && end.x < minScale) {
if (start.x > end.x) maxX = start.x;
else maxX = end.x;
}
if (start.y < minScale && end.y < minScale) {
if (start.y > end.y) maxY = start.y;
else maxY = end.y;
}
if (maxX == 0.0 && maxY == 0.0) return size;
if (maxX == 0.0) minXY = maxY;
else if (maxY == 0.0) minXY = maxX;
else if (maxX < maxY) minXY = maxX;
else minXY = maxY;
return (float)llCeil((minScale / minXY) * size);
}
unpackMessage(string msg)
{
list msgList = llCSV2List(msg);
integer on = (integer)llList2String(msgList, 0); // particles on/off
vector color = (vector)llList2String(msgList, 1); // particle color
float size = (float)llList2String(msgList, 2); // particle size (%) from notecard
float inc = (float)llList2String(msgList, 3); // particle increase/decrease (%) from menu
string texture = llList2String(msgList, 4); // particle texture from notecard
if (inc == 999) particleSize = size; // reset particle size
else particleSize += inc; // increase/decrease particle size
if (particleSize < 1) particleSize = 1; // correct if size < 1%
else if (particleSize > 100) particleSize = 100; // correct if size > 100%
if (particleSize < minParticleSize) particleSize = minParticleSize; // correct undersized particles
if (on) {
vector start = startScale / defParticleSize * particleSize; // start scale
vector end = endScale / defParticleSize * particleSize; // end scale
float min = minSpeed / defParticleSize * particleSize; // equally resize min. burst speed
float max = maxSpeed / defParticleSize * particleSize; // equally resize max. burst speed
float radius = burstRadius / defParticleSize * particleSize; // equally resize burst radius
vector push = partAccel / defParticleSize * particleSize; // equally resize accelleration
startParticles(color, start, end, min, max, radius, push, texture);
}
else {
llParticleSystem([]);
}
}
default
{
state_entry()
{
defParticleSize = getParticleSize(startScale, endScale); // default particle size (percentage)
vector start = startScale / defParticleSize; // start scale = 1%
vector end = endScale / defParticleSize; // end scale = 1%
minParticleSize = getMinSize(start, end, 1.0); // minimum particle size (percentage)
if (!silent) llWhisper(0, title + " \"" + name + "\" " + version + " ready");
llMessageLinked(LINK_THIS, feedbackChannel, "READY", ""); // request particle info from light script
}
on_rez(integer start_param)
{
llResetScript();
}
link_message(integer sender_number, integer number, string msg, key id)
{
if (number == particleChannel) unpackMessage(msg);
}
}

View File

@@ -1,48 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:56
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1789
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// Nightlight switch: drop this script into the same prim where the SWITCH is located
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Night light plugin for Rene's Free Lighting System
// A simple example script for creating your own plugin
//
// Automatically switches on at sunset and off at sunrise
/////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the SWITCH is located //
/////////////////////////////////////////////////////////////////////////////////
key owner; // object owner
integer number = 10957; // number part of link message
default
{
state_entry()
{
owner = llGetOwner();
llSetTimerEvent(300);
}
on_rez(integer start_param)
{
llResetScript();
}
timer()
{
vector sun = llGetSunDirection();
if (sun.z < 0) llMessageLinked(LINK_THIS, number, "on", owner);
else llMessageLinked(LINK_THIS, number, "off", owner);
}
}

View File

@@ -1,59 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:57
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1790
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// Proximity Switch: drop this script into the same prim where the SWITCH is located
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Proximity light plugin for Rene's Free Lighting System
// A simple example script for creating your own plugin
//
// Automatically switches on when an avatar comes within 10 meters
// Automatically switches off after one minute when no avatars are in range
/////////////////////////////////////////////////////////////////////////////////
// HOW TO USE: drop this script into the same prim where the SWITCH is located //
/////////////////////////////////////////////////////////////////////////////////
key owner; // object owner
integer number = 10957; // number part of link message
float range = 10.0; // scan range in meters
float rate = 10.0; // scan rate in seconds
default
{
state_entry()
{
owner = llGetOwner();
llSensorRepeat("", "", AGENT_BY_USERNAME, range, PI, rate);
}
on_rez(integer start_param)
{
llResetScript();
}
sensor(integer total_number)
{
rate = 60.0;
llMessageLinked(LINK_THIS, number, "on", owner);
llSensorRemove();
llSensorRepeat("", "", AGENT_BY_USERNAME, range, PI, rate);
}
no_sensor()
{
rate = 10.0;
llMessageLinked(LINK_THIS, number, "off", owner);
llSensorRemove();
llSensorRepeat("", "", AGENT_BY_USERNAME, range, PI, rate);
}
}

View File

@@ -1,82 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:52
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1786
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// RGB to LSL color conversion
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Rene's Free Lighting System - RGB to LSL color conversion
//
// Author: Rene10957 Resident
// Date: 12-01-2014
//
// Rez a cube, drop the script in it and touch it
// Enter the resulting color vector into the notecard next to "colorOn" or "colorOff"
string title = "Color converter"; // title
string version = "1.0"; // version
// Variables
integer boxChannel; // text box channel
integer boxHandle; // handle for text box listener
default
{
state_entry()
{
llWhisper(0, title + " " + version + " ready");
}
on_rez(integer start_param)
{
llResetScript();
}
touch_start(integer total_number)
{
boxChannel = (integer)(llFrand(-1000000000.0) - 1000000000.0);
llListenRemove(boxHandle);
boxHandle = llListen(boxChannel, "", "", "");
llSetTimerEvent(0);
llSetTimerEvent(120);
llTextBox(llDetectedKey(0), "\nEnter RGB color as <R,G,B>\ne.g. <255,0,0> for red", boxChannel);
}
listen(integer channel, string name, key id, string msg)
{
if (channel != boxChannel) return;
llSetTimerEvent(0);
llListenRemove(boxHandle);
vector rgb = (vector)msg;
vector lsl = rgb / 255.0;
vector per = lsl * 100.0;
per.x = (float)llRound(per.x);
per.y = (float)llRound(per.y);
per.z = (float)llRound(per.z);
llOwnerSay("RGB color = " + "< " + (string)((integer)rgb.x) + ", " +
(string)((integer)rgb.y) + ", " + (string)((integer)rgb.z) + " >");
llOwnerSay("LSL color = " + "< " + (string)lsl.x + ", " +
(string)lsl.y + ", " + (string)lsl.z + " >");
llOwnerSay("Notecard color = " + "< " + (string)((integer)per.x) + ", " +
(string)((integer)per.y) + ", " + (string)((integer)per.z) + " >");
}
timer()
{
llSetTimerEvent(0);
llListenRemove(boxHandle);
llOwnerSay("Text box timeout");
}
}

View File

@@ -1,27 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:53
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1787
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// Face picker: identify face numbers by touch
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Face picker: identify face numbers by touch
default
{
touch_start(integer total_number)
{
integer face = llDetectedTouchFace(0);
if (face == TOUCH_INVALID_FACE) llOwnerSay("Viewer does not support touched faces");
else llOwnerSay("Face " + (string)face);
}
}

View File

@@ -1,26 +0,0 @@
// :SHOW:1
// :CATEGORY:Light
// :NAME:Rene's Free Lighting System
// :AUTHOR:Rene10957 Resident
// :KEYWORDS: light,lamp,lighting light
// :CREATED:2015-06-11 14:41:54
// :EDITED:2015-06-12 16:41:14
// :ID:1079
// :NUM:1788
// :REV:1
// :WORLD:Opensim
// :DESCRIPTION:
// Removes floating text and then removes itself
// :CODE:
// :LICENSE: CC0 (Public Domain)
// Removes floating text and then removes itself
default
{
state_entry()
{
llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_TEXT, "", ZERO_VECTOR, 0.0]);
llRemoveInventory(llGetScriptName());
}
}

View File

@@ -1,3 +1,17 @@
// :SHOW:
// :CATEGORY:Building
// :NAME:Skirt Builder
// :AUTHOR:Dalien
// :KEYWORDS:
// :CREATED:2016-05-02 13:03:08
// :EDITED:2016-05-02 12:03:08
// :ID:1104
// :NUM:1891
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// A nice skirt maker
// :CODE:
// //
// Copyright (c) 2007 Dalien Talbot and few other folks thanks to whom this exists: // Copyright (c) 2007 Dalien Talbot and few other folks thanks to whom this exists:
// //

View File

@@ -1,3 +1,17 @@
// :SHOW:
// :CATEGORY:Building
// :NAME:Skirt Builder
// :AUTHOR:Dalien
// :KEYWORDS:
// :CREATED:2016-05-02 13:03:26
// :EDITED:2016-05-02 12:03:26
// :ID:1104
// :NUM:1892
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// A nice skirt maker
// :CODE:
// //
// Copyright (c) 2007 Dalien Talbot and few other folks thanks to whom this exists: // Copyright (c) 2007 Dalien Talbot and few other folks thanks to whom this exists:
// //

View File

@@ -1,6 +1,17 @@
//:AUTHOR: Ferd Frederix // :SHOW:
//:DESCRIPTION: Two Or more people sit on two or more pose balls. The pose balls play a series of animation in sync // :CATEGORY:Pose Ball
//:CODE: // :NAME:Synced Pose balls
// :AUTHOR:Ferd Frederix
// :KEYWORDS:
// :CREATED:2016-05-02 13:04:04
// :EDITED:2016-05-02 12:04:04
// :ID:1105
// :NUM:1893
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// Two Or more people sit on two or more pose balls. The pose balls play a series of animation in sync
// :CODE:
// To use this, just put several dances in a prim and add this script. // To use this, just put several dances in a prim and add this script.
// Shift-copy the prim. Anyone who touches it will dance in sync with anyone else who touches it. // Shift-copy the prim. Anyone who touches it will dance in sync with anyone else who touches it.

View File

@@ -1,3 +1,17 @@
// :SHOW:
// :CATEGORY:Chart
// :NAME:ThingSpeak Chart
// :AUTHOR:Ferd Frederix
// :KEYWORDS:
// :CREATED:2016-05-02 13:04:51
// :EDITED:2016-05-02 12:04:51
// :ID:1106
// :NUM:1894
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// An attempt at making Thingspeak charts in SL
// :CODE:
integer osIsNpc(key UUID) { return 0; } integer osIsNpc(key UUID) { return 0; }
@@ -128,4 +142,4 @@ default
} }
} }
} }