add web link to not6ecard giver

This commit is contained in:
Fred Beckhusen
2017-11-18 20:41:26 -06:00
parent 4b6d1f7292
commit e622132f03
16 changed files with 1114 additions and 336 deletions

View File

@@ -0,0 +1,3 @@
<Solution name="Boat and Car Rezzer">
<Project name="Boat and Car Rezzer" path="Boat and Car Rezzer\Boat and Car Rezzer.prj" active="true"/>
</Solution>

View File

@@ -0,0 +1,6 @@
<Project name="Boat and Car Rezzer" guid="f2e1b627-471d-44ce-8915-ac81d703c151">
<Object name="Object" guid="6cb33d72-678f-4bb0-a2ba-38ed0b869536" active="true">
<Script name="Rezzer script.lsl" guid="667fd5e2-2334-4149-9012-d30412001372">
</Script>
</Object>
</Project>

View File

@@ -0,0 +1,26 @@
//:AUTHOR: Ferd Frederix
// Used to rez boats, cars, and airplanes when the prior rezzed vehicle is moved out of range
// First add a llDie() to the rezzed objects 'unsit' section. HWen your visitor unsits, the vehicle will poof.
// Put the script in a prim and add the vehicle.
// Edit the prim and object at the same time, when the object appears. Move them together where you want them.
// Then make the box with this script invisible.
float scantime = 10; // keep this slow
float scandistance =1; // keep this small
default
{
state_entry() {
llSensorRepeat(llGetInventoryName(INVENTORY_OBJECT,0),"",SCRIPTED|ACTIVE|PASSIVE,scandistance,PI,scantime);
}
no_sensor() {
llRezObject(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos(),<0,0,0>,llGetRot(),0);
}
changed(integer what){
if (what & CHANGED_INVENTORY) {
llResetScript();
}
}
}

View File

@@ -0,0 +1,72 @@
// :NAME:Rat Race
// :World: Opensim, Second Life
// :LICENSE: CC_BY-NC-SA
// :Author: Ferd Frederix
//: Category: GIF
//: Rev: 1.0
//:CODE:
// put this script and multiple llTextAnimation-type textures (gifs) into a prim.
// The gifs need to be named with the number of X, Y frames, and the speed separated by a semicolon.
// Example:
// name;X;Y;FPS, where X and Y are integers,a FPS is a float
// animated butterfly;5;2;15 will be a 5 X 2 array played at 15 fps
// moving2;10;1;6.5 is a 10 X 1 playes at 6.5 fps
//
// Link as many of these prims as you want into an array. Now touch the prim to see the GIFS.
integer i = 0;
integer max;
Bump(integer i)
{
string name = llGetInventoryName(INVENTORY_TEXTURE,i);
list my_list = llParseString2List(name,["-"],[""]);
integer X = llList2Integer(my_list,1);
integer Y = llList2Integer(my_list,2);
float speed = llList2Float(my_list,3);
llSetTextureAnim( ANIM_ON | LOOP, 1,X,Y,0,0,speed);
llSetTexture(name,1);
}
default
{
state_entry()
{
max = llGetInventoryNumber(INVENTORY_TEXTURE);
llOwnerSay("Loaded " + (string) max);
Bump(0);
}
touch_start(integer total_number)
{
llMessageLinked(LINK_ALL_OTHERS, i, llDetectedName(0), llDetectedKey(0));
Bump(i);
i++;
if (i >= max)
i = 0;
}
changed(integer what)
{
if (what & CHANGED_INVENTORY)
llResetScript();
}
link_message(integer source, integer num, string str, key id)
{
//llOwnerSay((string) num);
Bump(num);
llSleep(1.0);
}
}

View File

@@ -0,0 +1,6 @@
<Project name="Hpergrid_Events_Sign" guid="1b37d5a3-7fed-4b31-b225-1e294f1f2506">
<Object name="SignPrim" guid="42557a60-b189-4be4-82f4-c079054aeac8" active="true">
<Script name="Script.lsl" guid="7aac30a3-5ee2-4f3b-a116-3ddb7971e05a">
</Script>
</Object>
</Project>

View File

@@ -0,0 +1,244 @@
//
// HYPEvents in-world teleporter board script
//
// Author: Tom Frost <tomfrost@linkwater.org>
//
// GPLv3
//
// configuration:
float refreshTime = 1800;
// internal, do not touch:
integer lineHeight = 30;
integer startY = 90;
integer texWidth = 512;
integer texHeight = 512;
key httpRequest;
list events;
integer channel;
integer listenHandle;
integer listening = 0;
list avatarDestinations = [];
//
// manipulate global avatarDestinations list
//
// insert or overwrite destination for agent with dest
//
tfSetAvatarDest(key agent, string dest)
{
list newList = [];
integer idx;
integer len = llGetListLength(avatarDestinations)/2;
integer set = FALSE;
for(idx=0;idx<len;idx++) {
key avatar = llList2Key(avatarDestinations, (idx*2));
if(avatar==agent) {
newList += [ agent, dest ];
set = TRUE;
} else {
newList += [ avatar, llList2String(avatarDestinations, (idx*2)+1) ];
}
}
if(!set) {
newList += [ agent, dest ];
}
avatarDestinations = newList;
}
//
// retrieve avatar dest from global avatarDestination list
//
// returns hgurl if destination set, NULL_KEY otherwise
//
string tfGetAvatarDest(key agent)
{
integer idx;
integer len = llGetListLength(avatarDestinations)/2;
for(idx=0;idx<len;idx++) {
if(llList2Key(avatarDestinations, (idx*2))==agent) {
return llList2String(avatarDestinations, (idx*2)+1);
}
}
return NULL_KEY;
}
doRequest()
{
httpRequest = llHTTPRequest("http://hypevents.net/events.lsl", [], "");
}
string tfTrimText(string in, string fontname, integer fontsize,integer width)
{
integer i;
integer trimmed = FALSE;
for(;llStringLength(in)>0;in=llGetSubString(in,0,-2)) {
vector extents = osGetDrawStringSize("vector",in,fontname,fontsize);
if(extents.x<=width) {
if(trimmed) {
return in + "..";
} else {
return in;
}
}
trimmed = TRUE;
}
return "";
}
refreshTexture()
{
string commandList = "";
integer fontSize=50;
commandList = osMovePen(commandList, 20, 5);
commandList = osDrawImage(commandList, 400, 70, "http://linkwater.org/dyntex/hypevents_logo.png");
commandList = osSetPenSize(commandList, 1);
commandList = osDrawLine(commandList, 0, 80, 512, 80);
integer numEvents = llGetListLength(events)/3;
integer i;
integer y = startY;
commandList = osSetFontName(commandList, "Arial");
commandList = osSetFontSize(commandList, 20);
for(i=0;i<numEvents;i++) {
integer base = i*3;
commandList = osMovePen(commandList, 10, y);
string text = llList2String(events, base+1) + " " + llList2String(events, base);
text = tfTrimText(text, "Arial", 20, texWidth-40);
commandList = osDrawText(commandList, text);
y += lineHeight;
}
osSetDynamicTextureData("", "vector", commandList, "width:"+(string)texWidth+",height:"+(string)texHeight, 0);
}
tfLoadURL(key avatar)
{
llLoadURL(avatar, "Visit the HYPEvents web-site for more detailed event information and technical information.", "http://hypevents.net/");
}
tfGoToEvent(key avatar, integer eventIndex)
{
integer numEvents = llGetListLength(events)/3;
integer base = eventIndex * 3;
if(eventIndex<numEvents) {
string text=llList2String(events, base+0);
text += "\n\n";
text += "The hypergrid url for this event is:\n\n"+llList2String(events, base+2)+"\n\n";
text += "Is this hgurl a hypergrid url for you or a local url?\n\n";
tfSetAvatarDest(avatar, llList2String(events, base+2));
llDialog(avatar, text, ["Hypergrid","Local grid", "Cancel"], channel);
if(listening==0) {
listenHandle = llListen(channel, "", NULL_KEY, "");
listening = (integer)llGetTime();
}
} else {
}
}
default
{
state_entry()
{
channel = -25673 - (integer)llFrand(1000000);
listening = 0;
avatarDestinations = [];
llSetTimerEvent(refreshTime);
doRequest();
}
http_response(key requestID, integer status, list metadata, string body)
{
if(status==200) {
events = llParseString2List(body, ["\n"], []);
refreshTexture();
} else {
llOwnerSay("Unable to fetch event.lsl, status: "+(string)status);
}
}
listen(integer chan, string name, key agent, string msg)
{
if(chan==channel) {
if(msg!="Cancel") {
string dest = tfGetAvatarDest(agent);
if(dest!=NULL_KEY) {
string dsturl = dest;
if(msg=="Local grid") {
list hgurl = llParseString2List(dest, [":"], []);
dsturl = llList2String(hgurl, 2);
}
osTeleportAgent(agent, dsturl, <128.0,128.0,23.0>, <1.0,1.0,0.0> );
}
}
}
}
touch_end(integer num)
{
integer i;
for(i=0;i<num;i++) {
vector touchPos = llDetectedTouchUV(i);
integer touchX = (integer)(touchPos.x * texWidth);
integer touchY = texHeight - (integer)(touchPos.y * texHeight);
key avatar = llDetectedKey(i);
if(touchY < 80) {
tfLoadURL(avatar);
} else if(touchY>=startY) {
integer touchIndex;
touchIndex = (integer)((touchY - startY) / lineHeight);
tfGoToEvent(avatar, touchIndex);
}
}
}
timer()
{
// timeout listener
if(listening!=0) {
if( (listening + 300) < (integer)llGetTime() ) {
llListenRemove(listenHandle);
avatarDestinations=[];
listening = 0;
}
}
// refresh texture
doRequest();
}
}

View File

@@ -0,0 +1,3 @@
<Solution name="Hypergrid_Events_Sign">
<Project name="Hpergrid_Events_Sign" path="Hpergrid_Events_Sign\Hpergrid_Events_Sign.prj" active="true"/>
</Solution>

View File

@@ -0,0 +1,108 @@
string URL ="http://www.hyperica.com/lookup/?cat=";
//Cat (category) numbers:
//0: WELCOME
//3: EDUCATION
//8: RETAIL
//10: VENUES
//Sort codes: 1=popularity 2=latest additions
string SimAddress; //the hypergrid address
string SimName; //the destination region name
string SimSnapshotURL; //URL of the photo -- this script doesn't use it, but you can use
string GridName; //name of the destination's grid
string SimLocation; //Upper, middle or lower
key httpkey;//This stores the key for the HTTP request we send.
string body_retrieved; // this will hold what is returned from http request
vector LandingPoint = <128.0, 128.0, 22.0>;
vector LookAt = <1.0,1.0,1.0>;
list LastFewAgents;
LoadDestination ()
{
list Description = llParseString2List(llGetObjectDesc(),[","," "],[]);
string Category = llList2String(Description,0);
integer CatNum = 0;
if (llToUpper(Category)=="EDUCATION") CatNum=3;
if (llToUpper(Category)=="RETAIL") CatNum=8;
if (llToUpper(Category)=="VENUES") CatNum=10;
URL = URL+(string) CatNum+"&region="+llList2String(Description,1)+"&sort=1";
llSay(0, URL);
httpkey=llHTTPRequest(URL, [] ,"");
llSetText("No destination set.",<1,1,1>,1);
}
PerformTeleport( key WhomToTeleport )
{
integer CurrentTime = llGetUnixTime();
integer AgentIndex = llListFindList( LastFewAgents, [ WhomToTeleport ] ); // Is the agent we're teleporting already in the list?
if (AgentIndex != -1) // If yes, check to make sure it's been > 5 seconds
{
integer PreviousTime = llList2Integer( LastFewAgents, AgentIndex+1 ); // Get the last time they were teleported
if (PreviousTime >= (CurrentTime - 30)) return; // Less than five seconds ago? Exit without teleporting
LastFewAgents = llDeleteSubList( LastFewAgents, AgentIndex, AgentIndex+1); // Delete the agent from the list
}
LastFewAgents += [ WhomToTeleport, CurrentTime ]; // Add the agent and current time to the list
llMapDestination(SimAddress, LandingPoint, LookAt);
//IF OS scripts are enabled, you can use this:
//osTeleportAgent( WhomToTeleport, SimAddress, LandingPoint, LookAt );
}
default
{
state_entry()
{
LoadDestination();
}
http_response(key id, integer status, list meta, string body)
{
body_retrieved = body;
SimName = llGetSubString(body_retrieved, llSubStringIndex(body,"<!--REGION NAME-->")+18, llSubStringIndex(body, "<!--END REGION NAME-->")-1);
GridName = llGetSubString(body_retrieved, llSubStringIndex(body,"<!--GRID NAME-->")+16, llSubStringIndex(body, "<!--END GRID NAME-->")-1);
SimLocation = llGetSubString(body_retrieved, llSubStringIndex(body,"<!--LOCATION-->")+15, llSubStringIndex(body, "<!--END LOCATION-->")-1);
SimAddress = llGetSubString(body_retrieved, llSubStringIndex(body,"<!--HGURL-->")+12, llSubStringIndex(body, "<!--END HGURL-->")-1);
llSetText("Hypergate to\n"+ SimName +"\non\n"+GridName,<1,1,1>,1);
string CommandList = "";
CommandList = osMovePen( CommandList, 25, 75 );
CommandList += "FontSize 16;";
CommandList = osDrawText( CommandList, SimName +" on "+GridName );
osSetDynamicTextureDataBlendFace( "", "vector", CommandList, "width:256,height:256", FALSE, 2, 0, 255, 3 );
}
touch_start(integer number)
{ LoadDestination(); }
collision(integer number)
{ PerformTeleport( llDetectedKey( 0 )); }
}

View File

@@ -0,0 +1,244 @@
//
// HYPEvents in-world teleporter board script
//
// Author: Tom Frost <tomfrost@linkwater.org>
//
// GPLv3
//
// configuration:
float refreshTime = 1800;
// internal, do not touch:
integer lineHeight = 30;
integer startY = 90;
integer texWidth = 512;
integer texHeight = 512;
key httpRequest;
list events;
integer channel;
integer listenHandle;
integer listening = 0;
list avatarDestinations = [];
//
// manipulate global avatarDestinations list
//
// insert or overwrite destination for agent with dest
//
tfSetAvatarDest(key agent, string dest)
{
list newList = [];
integer idx;
integer len = llGetListLength(avatarDestinations)/2;
integer set = FALSE;
for(idx=0;idx<len;idx++) {
key avatar = llList2Key(avatarDestinations, (idx*2));
if(avatar==agent) {
newList += [ agent, dest ];
set = TRUE;
} else {
newList += [ avatar, llList2String(avatarDestinations, (idx*2)+1) ];
}
}
if(!set) {
newList += [ agent, dest ];
}
avatarDestinations = newList;
}
//
// retrieve avatar dest from global avatarDestination list
//
// returns hgurl if destination set, NULL_KEY otherwise
//
string tfGetAvatarDest(key agent)
{
integer idx;
integer len = llGetListLength(avatarDestinations)/2;
for(idx=0;idx<len;idx++) {
if(llList2Key(avatarDestinations, (idx*2))==agent) {
return llList2String(avatarDestinations, (idx*2)+1);
}
}
return NULL_KEY;
}
doRequest()
{
httpRequest = llHTTPRequest("http://hypevents.net/events.lsl", [], "");
}
string tfTrimText(string in, string fontname, integer fontsize,integer width)
{
integer i;
integer trimmed = FALSE;
for(;llStringLength(in)>0;in=llGetSubString(in,0,-2)) {
vector extents = osGetDrawStringSize("vector",in,fontname,fontsize);
if(extents.x<=width) {
if(trimmed) {
return in + "..";
} else {
return in;
}
}
trimmed = TRUE;
}
return "";
}
refreshTexture()
{
string commandList = "";
integer fontSize=50;
commandList = osMovePen(commandList, 20, 5);
commandList = osDrawImage(commandList, 400, 70, "http://linkwater.org/dyntex/hypevents_logo.png");
commandList = osSetPenSize(commandList, 1);
commandList = osDrawLine(commandList, 0, 80, 512, 80);
integer numEvents = llGetListLength(events)/3;
integer i;
integer y = startY;
commandList = osSetFontName(commandList, "Arial");
commandList = osSetFontSize(commandList, 20);
for(i=0;i<numEvents;i++) {
integer base = i*3;
commandList = osMovePen(commandList, 10, y);
string text = llList2String(events, base+1) + " " + llList2String(events, base);
text = tfTrimText(text, "Arial", 20, texWidth-40);
commandList = osDrawText(commandList, text);
y += lineHeight;
}
osSetDynamicTextureData("", "vector", commandList, "width:"+(string)texWidth+",height:"+(string)texHeight, 0);
}
tfLoadURL(key avatar)
{
llLoadURL(avatar, "Visit the HYPEvents web-site for more detailed event information and technical information.", "http://hypevents.net/");
}
tfGoToEvent(key avatar, integer eventIndex)
{
integer numEvents = llGetListLength(events)/3;
integer base = eventIndex * 3;
if(eventIndex<numEvents) {
string text=llList2String(events, base+0);
text += "\n\n";
text += "The hypergrid url for this event is:\n\n"+llList2String(events, base+2)+"\n\n";
text += "Is this hgurl a hypergrid url for you or a local url?\n\n";
tfSetAvatarDest(avatar, llList2String(events, base+2));
llDialog(avatar, text, ["Hypergrid","Local grid", "Cancel"], channel);
if(listening==0) {
listenHandle = llListen(channel, "", NULL_KEY, "");
listening = (integer)llGetTime();
}
} else {
}
}
default
{
state_entry()
{
channel = -25673 - (integer)llFrand(1000000);
listening = 0;
avatarDestinations = [];
llSetTimerEvent(refreshTime);
doRequest();
}
http_response(key requestID, integer status, list metadata, string body)
{
if(status==200) {
events = llParseString2List(body, ["\n"], []);
refreshTexture();
} else {
llOwnerSay("Unable to fetch event.lsl, status: "+(string)status);
}
}
listen(integer chan, string name, key agent, string msg)
{
if(chan==channel) {
if(msg!="Cancel") {
string dest = tfGetAvatarDest(agent);
if(dest!=NULL_KEY) {
string dsturl = dest;
if(msg=="Local grid") {
list hgurl = llParseString2List(dest, [":"], []);
dsturl = llList2String(hgurl, 2);
}
osTeleportAgent(agent, dsturl, <128.0,128.0,23.0>, <1.0,1.0,0.0> );
}
}
}
}
touch_end(integer num)
{
integer i;
for(i=0;i<num;i++) {
vector touchPos = llDetectedTouchUV(i);
integer touchX = (integer)(touchPos.x * texWidth);
integer touchY = texHeight - (integer)(touchPos.y * texHeight);
key avatar = llDetectedKey(i);
if(touchY < 80) {
tfLoadURL(avatar);
} else if(touchY>=startY) {
integer touchIndex;
touchIndex = (integer)((touchY - startY) / lineHeight);
tfGoToEvent(avatar, touchIndex);
}
}
}
timer()
{
// timeout listener
if(listening!=0) {
if( (listening + 300) < (integer)llGetTime() ) {
llListenRemove(listenHandle);
avatarDestinations=[];
listening = 0;
}
}
// refresh texture
doRequest();
}
}

View File

@@ -1,3 +1,3 @@
<Solution name="NotecardGiver">
<Project name="NotecardGiver" path="NotecardGiver\NotecardGiver.prj" active="true"/>
<Project name="NotecardGiver" path="NotecardGiver\NotecardGiver.prj" active="true"/>
</Solution>

View File

@@ -1,6 +1,6 @@
<Project name="NotecardGiver" guid="D66611D8-6C00-1014-B904-200204C60A89">
<Object name="Object" guid="D66612B6-6C00-1014-B904-200204C60A89">
<Script name="NotecardGiver_1.lsl" guid="D66B1FB3-6C00-1014-B904-200204C60A89">
<Project name="NotecardGiver" guid="d66611d8-6c00-1014-b904-200204c60a89">
<Object name="Object" guid="d66612b6-6c00-1014-b904-200204c60a89">
<Script name="NotecardGiver_1.lsl" guid="d66b1fb3-6c00-1014-b904-200204c60a89">
</Script>
</Object>
</Project>

View File

@@ -1,12 +1,11 @@
// :CATEGORY:Inventory Giver
// :NAME:NotecardGiver
// :NAME:NotecardGiver with web link
// :AUTHOR:Encog Dod
// :CREATED:2010-01-10 05:20:56.000
// :EDITED:2013-09-18 15:38:58
// :ID:565
// :NUM:769
// :REV:1.0
// :WORLD:Second Life
// :REV:2.0
// :WORLD:Second Life, Opensim
// :DESCRIPTION:
// NotecardGiver
// :CODE:
@@ -23,40 +22,53 @@
// For more information about this book visit the following web site:
//
// http://www.heatonresearch.com/articles/series/22/
// Mod to give out a web link added by Ferd
// Tuneable things you need to set
integer giveNotecard = TRUE;
integer giveWebSite = TRUE;
string Message = "Visit the Outworldz Website";
string WebLink = "http://www.outworldz.com";
float Distance = 20;
string notecard = "Welcome Notecard";
integer freq = 1;
integer maxList = 100;
list given;
integer freq = 5; // how often it scans, Keep this slow.
integer maxList = 100; // saves the last 100 people to avoid spamming
list given; // the list of people
default
{
state_entry()
{
llSensorRepeat("", "",AGENT, 20, PI, freq);
llSetText("", <1.0, 1.0, 1.0>, 1.0);
}
sensor(integer num_detected)
{
integer i;
key detected;
for(i=0;i<num_detected;i++)
{
detected = llDetectedKey(i);
if( llListFindList(given, [detected]) < 0 )
{
given += llDetectedKey(i);
llGiveInventory(detected, notecard);
if (llGetListLength(given) >= maxList)
{
given = llDeleteSubList(given,0,10);
}
}
}
}
state_entry()
{
llSensorRepeat("", "",AGENT, Distance, PI, freq);
}
sensor(integer num_detected)
{
integer i;
key detected;
for(i=0;i<num_detected;i++)
{
detected = llDetectedKey(i);
if( llListFindList(given, [detected]) < 0 )
{
given += llDetectedKey(i);
if (giveNotecard) {
llGiveInventory(detected, notecard);
}
if (giveWebSite) {
llLoadURL(detected,Message, WebLink);
}
if (llGetListLength(given) >= maxList)
{
given = llDeleteSubList(given,0,0);
}
}
}
}
}

View File

@@ -1,298 +1,302 @@
// :CATEGORY:Resizer
// :NAME:Resize_Script
// :AUTHOR:Daemonika Nightfire
// :CREATED:2013-06-24 14:24:19.460
// :EDITED:2013-09-18 15:39:01
// :ID:699
// :NUM:954
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// *DS* Resize Script (m/c/t) by Daemonika Nightfire (daemonika.nightfire)
//
// Resize Script for rezzed Objects and Attachments.
// Single-script for a complete linkset with save and restore option.
//
// Featueres:
// • By the first run or reset of this script, it will ask you to save all parameters.
// The parameters will be stored in the descriptionfield of each prim, that needs no script-memory :)
// • You can save, resize and restore individual prims or the complette linkset.
// • Deleting this script from the object is not required because its only one.
//
// Standby-Time ~ 0.004 ms
// Working-Time with 200 moving Prims ~ 4.000 up to 16.000 ms
// after finalizing Standby-Time ~ 0.004 ms again
//
// Note:
// • You have to stand on a posestand, if you want to edit attached attachments.
// This is necessary because otherwise the linkset is misadjusted, if you move your avatar during the process.
//
// Important:
// • Undersize is possible, but take care.
// if you are small your object and several prims already have minimum dimensions, they are not further reduced, but they are moved proportionally.
// Sculpted Prims are no problem, but take care.
// Sculpties with moved Bounding Box perhaps moving optical not correct
// That is not true, they are moving correctly, but when the visible Sculptie is not the center of the Bounding Box, it will be looking wrong.
//
// Terms of use:
// You can use, edit and sell this script inside your creations with the following permissions in Second Life:
// • MOD Yes • COPY Yes • TRANSFER Yes
//
// Yes that means fullperm. Other settings, are against the following licenses.
// The permission of your Object (prim), remain unaffected by these terms
//
https://wiki.secondlife.com/wiki/User:Daemonika_Nightfire/Scripts/*DS*_Resize_Script
http://wiki.secondlife.com/wiki/Project:Terms_of_Service
http://creativecommons.org/licenses/by-sa/3.0/
//
// violation of this Terms are against the Second Life TOS at §7 Content Licenses and Intellectual Property Rights.
http://secondlife.com/corporate/tos.php
// :CODE:
key owner;
integer new = TRUE;
integer LinkSet = TRUE;
integer Prim;
integer Channel;
integer Listener;
Chan()
{
llListenRemove(Listener);
Channel = (integer)(llFrand(999999.0) * -1);
Listener = llListen(Channel, "", owner, "");
llSetTimerEvent(60);
}
menu1()
{
Chan();
if(new)
{
llDialog(owner, "\nYour first run or reset of this script.\nDo you whish to save current parameters?",
["Save","Later"], Channel);
}
else
{
llDialog(owner, "\nselect an option\nThis = touched Prim\nAll = complete Object",
["This","All","Done"], Channel);
}
}
menu2()
{
Chan();
llDialog(owner, "\n+ - = resize\nSave = record all parameters\nRestore = restore saved parameters",
["Save","Restore","Done","-1%","-5%","-10%","+1%","+5%","+10%"], Channel);
}
default
{
state_entry()
{
owner = llGetOwner();
llWhisper(0,"/me " + llGetScriptName() + " Free Memory: " + (string)llGetFreeMemory() + " bytes.");
}
touch_start(integer total_number)
{
owner = llGetOwner();
if(llDetectedKey(0) == owner)
{
if(llGetAttached() != 0)
{
if(llGetAgentInfo(owner) & AGENT_SITTING)
{
Prim = llDetectedLinkNumber(0);
menu1();
}
else
{
llOwnerSay("Please use a posing stand for resizing!");
}
}
else
{
Prim = llDetectedLinkNumber(0);
menu1();
}
}
}
listen(integer channel, string name, key id, string msg)
{
float shift = 0;
vector position;
vector size;
list link;
integer i;
if(msg == "This")
{
LinkSet = FALSE;
menu2();
}
else if(msg == "All")
{
LinkSet = TRUE;
menu2();
}
else if(msg == "Done" || msg == "Later")
{
llListenRemove(Listener);
llSetTimerEvent(0);
}
else if(msg == "-1%")
{
shift = 0.99;
}
else if(msg == "-5%")
{
shift = 0.95;
}
else if(msg == "-10%")
{
shift = 0.9;
}
else if(msg == "+1%")
{
shift = 1.01;
}
else if(msg == "+5%")
{
shift = 1.05;
}
else if(msg == "+10%")
{
shift = 1.1;
}
// Record
else if(msg == "Save")
{
// :CATEGORY:Resizer
// :NAME:Resize_Script
// :AUTHOR:Daemonika Nightfire
// :CREATED:2013-06-24 14:24:19.460
// :EDITED:2013-09-18 15:39:01
// :ID:699
// :NUM:954
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// *DS* Resize Script (m/c/t) by Daemonika Nightfire (daemonika.nightfire)//
// Resize Script for rezzed Objects and Attachments.
// Single-script for a complete linkset with save and restore option.
//
// Features:
// • By the first run or reset of this script, it will ask you to save all parameters.
// The parameters will be stored in the descriptionfield of each prim, that needs no script-memory :)
// • You can save, resize and restore individual prims or the complette linkset.
// • Deleting this script from the object is not required because its only one.
//
// Standby-Time ~ 0.004 ms
// Working-Time with 200 moving Prims ~ 4.000 up to 16.000 ms
// after finalizing Standby-Time ~ 0.004 ms again
//
// Note:
// • You have to stand on a posestand, if you want to edit attached attachments.
// This is necessary because otherwise the linkset is misadjusted, if you move your avatar during the process.
//
// Important:
// • Undersize is possible, but take care.
// if you are small your object and several prims already have minimum dimensions, they are not further reduced, but they are moved proportionally.
// • Sculpted Prims are no problem, but take care.
// Sculpties with moved Bounding Box perhaps moving optical not correct
// That is not true, they are moving correctly, but when the visible Sculptie is not the center of the Bounding Box, it will be looking wrong.
//
// Terms of use:
// You can use, edit and sell this script inside your creations with the following permissions in Second Life:
// • MOD Yes • COPY Yes • TRANSFER Yes
//
// Yes that means fullperm. Other settings, are against the following licenses.
// The permission of your Object (prim), remain unaffected by these terms
//
https://wiki.secondlife.com/wiki/User:Daemonika_Nightfire/Scripts/*DS*_Resize_Script
http://wiki.secondlife.com/wiki/Project:Terms_of_Service
http://creativecommons.org/licenses/by-sa/3.0/
//
// violation of this Terms are against the Second Life TOS at §7 Content Licenses and Intellectual Property Rights.
http://secondlife.com/corporate/tos.php
// :CODE:
key owner;
integer new = TRUE;
integer LinkSet = TRUE;
integer Prim;
integer Channel;
integer Listener;
Chan()
{
llListenRemove(Listener);
Channel = (integer)(llFrand(999999.0) * -1);
Listener = llListen(Channel, "", owner, "");
llSetTimerEvent(60);
}
menu1()
{
Chan();
if(new)
{
llDialog(owner, "\nYour first run or reset of this script.\nDo you wish to save current parameters?",
["Save","Later"], Channel);
}
else
{
llDialog(owner, "\nselect an option\nThis = touched Prim\nAll = complete Object",
["This","All","Done"], Channel);
}
}
menu2()
{
Chan();
llDialog(owner, "\n+ - = resize\nSave = record all parameters\nRestore = restore saved parameters",
["Save","Restore","Done","-1%","-5%","-10%","+1%","+5%","+10%"], Channel);
}
default
{
state_entry()
{
owner = llGetOwner();
llWhisper(0,"/me " + llGetScriptName() + " Free Memory: " + (string)llGetFreeMemory() + " bytes.");
}
touch_start(integer total_number)
{
owner = llGetOwner();
if(llDetectedKey(0) == owner)
{
if(llGetAttached() != 0)
{
if(llGetAgentInfo(owner) & AGENT_SITTING)
{
Prim = llDetectedLinkNumber(0);
menu1();
}
else
{
llOwnerSay("Please use a posing stand for resizing!");
}
}
else
{
Prim = llDetectedLinkNumber(0);
menu1();
}
}
}
listen(integer channel, string name, key id, string msg)
{
float shift = 0;
vector position;
vector size;
list link;
integer i;
if(msg == "This")
{
LinkSet = FALSE;
menu2();
}
else if(msg == "All")
{
LinkSet = TRUE;
menu2();
}
else if(msg == "Done" || msg == "Later")
{
llListenRemove(Listener);
llSetTimerEvent(0);
}
else if(msg == "-1%")
{
shift = 0.99;
}
else if(msg == "-5%")
{
shift = 0.95;
}
else if(msg == "-10%")
{
shift = 0.9;
}
else if(msg == "+1%")
{
shift = 1.01;
}
else if(msg == "+5%")
{
shift = 1.05;
}
else if(msg == "+10%")
{
shift = 1.1;
}
// Record
else if(msg == "Save")
{
llOwnerSay("Please wait...");
if(!LinkSet)
{
link = llGetLinkPrimitiveParams(Prim, [PRIM_SIZE , PRIM_POSITION]);
position = llList2Vector(link, 1);
position = (position - llGetRootPosition()) / llGetRootRotation();
size = llList2Vector(link, 0);
llSetLinkPrimitiveParamsFast(Prim,[PRIM_DESC,(string)size + "#" + (string)position]);
}
else
{
for(i = 0; i <= llGetNumberOfPrims(); i++)
{
link = llGetLinkPrimitiveParams(i, [PRIM_SIZE , PRIM_POSITION]);
size = llList2Vector(link, 0);
position = llList2Vector(link, 1);
position = (position - llGetRootPosition()) / llGetRootRotation();
if(i > 1)
{
llSetLinkPrimitiveParamsFast(i,[PRIM_DESC,(string)size + "#" + (string)position]);
}
else
{
llSetLinkPrimitiveParamsFast(i,[PRIM_DESC,(string)size]);
}
}
new = FALSE;
}
llOwnerSay("All parameters are stored");
menu2();
}
// Restore
else if(msg == "Restore")
{
if(!new)
{
llOwnerSay("Please wait...");
if(!LinkSet)
{
link = llGetLinkPrimitiveParams(Prim, [PRIM_DESC]);
list parsed = llParseString2List(llList2CSV(link), ["#"], []);
string vect = llList2String(parsed, 0);
size = (vector)vect;
llSetLinkPrimitiveParamsFast(Prim, [PRIM_SIZE, size]);
}
else
{
for(i = 0; i <= llGetNumberOfPrims(); i++)
{
link = llGetLinkPrimitiveParams(i, [PRIM_DESC]);
list parsed = llParseString2List(llList2CSV(link), ["#"], []);
string vect = llList2String(parsed, 0);
size = (vector)vect;
string posi = llList2String(parsed, 1);
position = (vector)posi;
if(i > 1)
{
llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size, PRIM_POSITION, position]);
}
else
{
llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size]);
}
}
}
llOwnerSay("All stored parameters restored.");
menu2();
}
else if(new)
{
llOwnerSay("Please first save all paremeters to use this.");
}
}
// Resize
if(shift != 0)
{
llOwnerSay("Please wait...");
if(!LinkSet)
{
link = llGetLinkPrimitiveParams(Prim, [PRIM_SIZE]);
size = llList2Vector(link, 0) * shift;
llSetLinkPrimitiveParamsFast(Prim, [PRIM_SIZE, size]);
}
else
{
for(i = 0; i <= llGetNumberOfPrims(); i++)
{
link = llGetLinkPrimitiveParams(i, [PRIM_SIZE, PRIM_POSITION]);
size = llList2Vector(link, 0) * shift;
position = llList2Vector(link, 1);
position = (position - llGetRootPosition()) / llGetRootRotation() * shift;
if(i > 1)
{
llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size, PRIM_POSITION, position]);
}
else
{
llSetLinkPrimitiveParamsFast(i, [PRIM_SIZE, size]);
}
}
}
llOwnerSay("Finish.");
menu2();
}
}
timer()
{
llSetTimerEvent(0);
llListenRemove(Listener);
llOwnerSay("Listener timeout, please touch again to use the menu.");
}
on_rez(integer Dae)
{
if(new)
{
llResetScript();
}
}
}

View File

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

View File

@@ -0,0 +1,41 @@
integer count ;
integer current = 0;
SetLinkTextureFast( string texture, integer face)
{
llSetLinkPrimitiveParamsFast(LINK_ROOT, [PRIM_TEXTURE, face, texture,<1,1,0>,<0,0,0>,0
]);
}
// PRIM_TEXTURE, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians
default
{
state_entry()
{
count = llGetInventoryNumber(INVENTORY_TEXTURE);
llSetTimerEvent(5);
}
on_rez(integer p) {
llResetScript();
}
timer() {
string texturename = llGetInventoryName(INVENTORY_TEXTURE,current);
SetLinkTextureFast(texturename,1); // do side one
current++;
if (current >= count)
current = 0;
texturename = llGetInventoryName(INVENTORY_TEXTURE,current);
SetLinkTextureFast(texturename,2); // do side two to cache it
}
// if necessary, uncomment this, then touch a face to get the number for use with SetLinkTexture
// touch_start(integer n) {
// integer face = llDetectedTouchFace(0);
// llSay(0,(string) face);
//}
}

View File

@@ -0,0 +1,6 @@
<Project name="SignChanger" guid="4fb2701b-ac92-4ea8-ab72-c21282933ed1">
<Object name="Object" guid="909d860d-3c2e-4aec-920b-2b4c70b67641" active="true">
<Script name="Script.lsl" guid="78137450-8e11-4d91-a1e0-022452fa7e4f">
</Script>
</Object>
</Project>