Jump to content

help identify the unknown script


ainst Composer
 Share

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! A friend gave me a script, but neither she nor I know what it is for. can someone say what the script is and what is it for? (script name: desaparecer despacio)



//
// USER VARIABLES
//


//
//  INTERNAL VARIABLES
//

vector home;
integer penState;
float penColor;
float color;
float ghost;
vector originalScale;
float sizePercent;
integer numAvatarsNearby;
vector nearestAvPosition;
key ownerKey;
vector ownerPosition;

//
//   INTERNAL FUNCTIONS
//

// move(steps)
// move object a number of steps (meters) along its current heading
// forward is along the positive x axis
// if the pen is down, create a line segment along the path traveled
// the line is positioned by its center, which is placed halfway back along the path
move(float steps) 
{
    vector fwd = llRot2Fwd(llGetRot()) * steps;
    llSetPos(llGetPos() + fwd);
    if (penState == TRUE) {
        if (llGetInventoryType("lineSegment") == INVENTORY_NONE) {
            llSay(0, "Oops! To draw a line, my inventory needs a lineSegment. You can get one from the Scratch Inventory Box.");
        } else { 
            integer randomID = llRound(llFrand(99999999));
               llRezObject("lineSegment", llGetPos()-fwd/2, <0,0,0>, llGetRot(), randomID);
               llSay(1, (string)randomID + ":set length:"+ (string)llFabs(steps));
               llSay(1, (string)randomID + ":set color:" + (string)penColor);
        }
    }
}
// turnRight(float angle)
// turn angle degrees clockwise around the local z axis
turnRight(float angle)
{
    angle *= -1;
    rotation newRot = llEuler2Rot(<0,0,angle> * DEG_TO_RAD);
    llSetRot(newRot*llGetRot());    
}
// turnLeft(float angle)
// turn angle degrees counterclockwise around the local z axis
turnLeft(float angle)
{ 
    rotation newRot = llEuler2Rot(<0,0,angle> * DEG_TO_RAD);
    llSetRot(newRot*llGetRot());    
}
//up(float steps)
//move up along the global z axis by steps meters
//does not leave a line segment
up(float steps)
{
    llSetPos(llGetPos()+<0,0,steps>);   
}
//down(float steps)
//move down along the global z axis by steps meters
//does not leave a line segment
down(float steps)
{
    llSetPos(llGetPos()+<0,0,-1*steps>);   
}
// turnPitch(float angle)
// turn angle degrees upward around the local y axis
turnPitch(float angle)
{
    angle *= -1;
    rotation newRot = llEuler2Rot(<0,angle,0> * DEG_TO_RAD);
    llSetRot(newRot*llGetRot());    
}
// float getHeading()
// return the current heading in the xy plane in degrees 
float getHeading() {
    return llRot2Angle(llGetRot())*RAD_TO_DEG;
}
// setHeading(float angle)
// set the heading in the xy plane in degrees
setHeading(float angle) {
    vector newVec = <0, 0, angle*DEG_TO_RAD>;
    rotation newRot = llEuler2Rot(newVec);
    llSetRot(newRot);   
}
// turnRoll(float angle)
// turn angle degrees clockwise around the local x axis
turnRoll(float angle)
{
    rotation newRot = llEuler2Rot(<angle,0,0> * DEG_TO_RAD);
    llSetRot(newRot*llGetRot());    
}
// changePenColorBy(float num)
// change the pen color by an amount
changePenColorBy(float num)
{
        penColor += num;
    setPenColorTo(penColor);
}
// setPenColorTo(float num)
// set the pen to a particular color
setPenColorTo(float num)
{
    penColor = (integer)num % 100;
}
// penDown()
// put the pen down, so that when the object moves it will draw
penDown() {
    penState = TRUE;
}
// penUp()
// put the pen up, so that the object will not draw when it moves
penUp() {
    penState = FALSE;
}
// clear()
// broadcast a message to nearby line segments that will cause them to 
// delete themselves
clear() {
    llSay(1, "clearLineSegments");
}
// pointTowardNearestAv()
// turn to point toward the nearest avatar
pointTowardNearestAv()
{
    vector myPos = llGetPos();
    float xdiff = myPos.x - nearestAvPosition.x;
    float ydiff = myPos.y - nearestAvPosition.y;
    float angle = llAtan2(xdiff, ydiff) * RAD_TO_DEG; 
    setHeading(270 - angle);
}
// pointTowardOwner()
// turn to point toward the owner
pointTowardOwner()
{
    vector myPos = llGetPos();
    float xdiff = myPos.x - ownerPosition.x;
    float ydiff = myPos.y - ownerPosition.y;
    float angle = llAtan2(xdiff, ydiff) * RAD_TO_DEG; 
    setHeading(270 - angle);
}
// float distanceToNearestAv()
// returns the distance in meters to the nearest avatar
float distanceToNearestAv()
{
    return llVecDist(llGetPos(), nearestAvPosition);
}
// float distanceToOwner()
// returns the distance in meters to the owner
float distanceToOwner()
{
    return llVecDist(llGetPos(), ownerPosition);
}
// float randomMinToMax(float min, float max)
// returns a random number between min and max
integer randomMinToMax(float min, float max)
{
    return llRound(llFrand(max - min) + min);
}
// say(string text) 
// say the text on the public chat channel 0 so all nearby avatars and objects will hear it
say(string text) 
{
    llSay(0, text);
}
// broadcast(string message)
// say the message on channel 1.  No avatars will hear it.
// all nearby objects will hear it.
broadcast(string message)
{
    llSay(1, message);
}
// setText(string text)
// create opaque white floating text above the object
setText(string text)
{
    llSetText(text, <1,1,1>, 1);
}
// vector hueToRGB(float h)
// take a color represented as a hue value between 1 and 100 and 
// return an RGB vector representing the same color.
vector hueToRGB(float h)
{
    integer i;
    float f;
    float p;
    float q;
    float t;
    float r;
    float g;
    float b;
    float s = 1;
    float v = 1;
    h *= 5;            // sector 0 to 5
    i = llFloor(h);
    f = h - i;            // factorial part of h
    p = v * ( 1 - s );
    q = v * ( 1 - s * f );
    t = v * ( 1 - s * ( 1 - f ) );

    if (i == 0) {
            r = v;
            g = t;
            b = p;
    } else if (i == 1) {
            r = q;
            g = v;
            b = p;
     } else if (i == 2) {
            r = p;
            g = v;
            b = t;
    } else if (i == 3) {
            r = p;
            g = q;
            b = v;
    } else if (i == 4) {
            r = t;
            g = p;
            b = v;
    } else {
            r = v;
            g = p;
            b = q;
    }
    return <r,g,b>;
}
// setColor(float num)
// set the color of the object using a number between 1 and 100 representing a hue
setColor(float num)
{
     color = (integer)num % 100;    
    llSetColor(hueToRGB(color / 100), ALL_SIDES);
    if (llGetObjectName() == "Scratch Bug") {
        llSetLinkColor(2, hueToRGB(color / 100), ALL_SIDES);
    } else {
        //llSetLinkColor(LINK_SET, hueToRGB(color / 100), ALL_SIDES);
    }
}
// changeColorBy(float num)
// change the hue of the object by a number
changeColorBy(float num)
{
    float newColor = color + num;
    if (newColor < 0) {
        newColor = 0;
    }
    if (newColor > 100) {
        newColor = 100;
    }
    setColor(newColor);
}
// setGhost(float num)
// set the ghost effect of the object to a value between 0 (opaque) and 100 (transparent)
setGhost(float num)
{
    ghost = (integer)num % 101;
    llSetAlpha(((100 - ghost) / 100), ALL_SIDES);
    llSetLinkAlpha(LINK_SET, ((100 - ghost) / 100), ALL_SIDES);
}
// changeGhostBy(float num) 
// change the ghost effect on an object by a number
changeGhostBy(float num) 
{
    setGhost(ghost + num);
}
// setSize(float newSize)
// set the size of the object to a percentage of its original size
setSize(float newSize)
{
    sizePercent = newSize;
    vector newScale = originalScale*(sizePercent/100); 
    llSetScale(newScale);
}
// changeSizeBy(float change)
// change the size of an object by a percentage of its original size
changeSizeBy(float change)
{
    sizePercent += change;
    vector newScale = originalScale*(sizePercent/100); 
    llSetScale(newScale);
}
// playSound(string snd)
// play a sound at full volume
// snd can be the name of a sound in the inventory of the object, or the
// UUID of a sound which exists somewhere else
playSound(string snd) 
{
    llPlaySound(snd, 1);
}
// playSoundNamed(string snd)
// play a sound at full volume
// snd can be the name of a sound in the inventory of the object, or the
// UUID of a sound which exists somewhere else
// this is the version for text input of the name of a sound in a scratch block
// so it checks the inventory and gives an error if the sound is missing
playSoundNamed(string snd) 
{
    if (llGetInventoryType(snd) == INVENTORY_NONE) {
        llSay(0, "Oops! My inventory does not contain the sound " + snd);
    } else { 
        llPlaySound(snd, 1);
    }
}
// wait(float secs)
// pause all execution of this script for some number of seconds
wait(float secs)
{
    llSleep(secs);
}
// levelOut()
// remove the x and y rotation components, so that the object is
// level with respect to the ground
levelOut()
{
    vector myVec = llRot2Euler(llGetRot());
    vector newVec = <0, 0, myVec.z>;
    rotation newRot = llEuler2Rot(newVec);
    llSetRot(newRot);
}
// goHome() 
// move the object back to its home position
// home is set the the position of the object when it is created,
// and can be set to a new position using setHomeHere()
goHome() 
{
    llSetPos(home);
    //levelOut();
}
// setHomeHere()
// set the home position to the current position
setHomeHere()
{
        home = llGetPos();
}
// startListening() 
// listen for messages on both channel 0, the public channel,
// and channel 1, where broadcasts are sent     
startListening() 
{
    llListen(0, "", "", "");
    llListen(1, "", "", "");
}   
// initInternal()
// do some setup for internal functions
// this includes setting various variables to their defaults
// clearing text on the object, and turning on
// the repeating sensor and timer events
initInternal()
{
       setHomeHere();
        penState = FALSE;
        penColor = 0;
       color = 0;
       ghost = 0;
        sizePercent = 100;
        originalScale = llGetScale();
       ownerKey = llGetOwner();
       llSetText("", <1,1,1>, 0);
       llSensorRepeat("", "", AGENT, 96, PI, .1);
       llSetTimerEvent(.1);
       startListening();
}
initAll() {
    initInternal();
}
timer1(){
   wait(15);
   setGhost(0);
   wait(0.1);
   setGhost(0.1);
   wait(0.1);
   setGhost(0.3);
   wait(0.1);
   setGhost(0.5);
   wait(0.1);
   setGhost(1);
   wait(0.1);
   setGhost(2);
   wait(0.1);
   setGhost(3);
   wait(0.1);
   setGhost(4);
   wait(0.1);
   setGhost(5);
   wait(0.1);
   setGhost(7);
   wait(0.1);
   setGhost(10);
   wait(0.1);
   setGhost(15);
   wait(0.1);
   setGhost(20);
   wait(0.1);
   setGhost(25);
   wait(0.1);
   setGhost(30);
   wait(0.1);
   setGhost(35);
   wait(0.1);
   setGhost(40);
   wait(0.1);
   setGhost(45);
   wait(0.1);
   setGhost(50);
   wait(0.1);
   setGhost(55);
   wait(0.1);
   setGhost(60);
   wait(0.1);
   setGhost(65);
   wait(0.1);
   setGhost(70);
   wait(0.1);
   setGhost(75);
   wait(0.1);
   setGhost(80);
   wait(0.1);
   setGhost(85);
   wait(0.1);
   setGhost(90);
   wait(0.1);
   setGhost(95);
   wait(0.1);
   setGhost(96);
   wait(0.1);
   setGhost(97);
   wait(0.1);
   setGhost(98);
   wait(0.1);
   setGhost(99);
   wait(0.1);
   setGhost(100);
   wait(15);
   setGhost(99);
   wait(0.1);
   setGhost(97);
   wait(0.1);
   setGhost(95);
   wait(0.1);
   setGhost(90);
   wait(0.1);
   setGhost(85);
   wait(0.1);
   setGhost(80);
   wait(0.1);
   setGhost(75);
   wait(0.1);
   setGhost(70);
   wait(0.1);
   setGhost(65);
   wait(0.1);
   setGhost(60);
   wait(0.1);
   setGhost(55);
   wait(0.1);
   setGhost(50);
   wait(0.1);
   setGhost(45);
   wait(0.1);
   setGhost(40);
   wait(0.1);
   setGhost(35);
   wait(0.1);
   setGhost(30);
   wait(0.1);
   setGhost(25);
   wait(0.1);
   setGhost(20);
   wait(0.1);
   setGhost(15);
   wait(0.1);
   setGhost(10);
   wait(0.1);
   setGhost(7);
   wait(0.1);
   setGhost(5);
   wait(0.1);
   setGhost(4);
   wait(0.1);
   setGhost(3);
   wait(0.1);
   setGhost(2);
   wait(0.1);
   setGhost(1);
   wait(0.1);
   setGhost(0.5);
   wait(0.1);
   setGhost(0.3);
   wait(0.1);
   setGhost(0);
}
default
{
    state_entry()
    {
        initAll();
    }
    on_rez(integer start_param)
    {
        initAll();
    }
    sensor(integer n)
    {
        numAvatarsNearby = n;
        nearestAvPosition = llDetectedPos(0);
        integer i;
        for (i=0; i<n; i++) {
            if (llDetectedKey(i) == ownerKey) {
                ownerPosition = llDetectedPos(i);
            }
        }
    }
    touch_start(integer n) {
    }
    collision_start(integer n) {
    }
    listen(integer channel, string name, key id, string msg) {
    }
    timer() {
        timer1();
    }

  }

 

Link to comment
Share on other sites

As written, the script does nothing.  The sensor, collision_start, listen, touch_start, and timer events are all disabled or do trivial things.  The bulk of the script is a stack of rather clumsy user-defined functions that appear to be intended for marking a path -- probably one of those cute things that leave a trail of particle footprints behind you as you walk.  It's fun to be curious about an odd script like this, but I would advise you never to use a script unless you understand what it's for.  Personally, I barely trust my own scripts to behave properly on a good day. 😊  I would be very cautious with a random script from some unknown source.  If you want a script to do something specific, write it yourself or work with a trusted scripter.

  • Thanks 1
Link to comment
Share on other sites

It looks to me as if somebody has got one of the old turtle graphics scripts and begun converting it to lsl. The things Rolig has mentioned are probably leftovers from the sample script the person was adapting. If you are a premium member, go to a premium sandbox to try this sort of thing out, don't risk it on a parcel with other users's property close by.

  • Thanks 1
Link to comment
Share on other sites

1 minute ago, Estelle Pienaar said:

Also if you don't have the rights to a script, keep in mind that the author might take an issue with it being published.

LSL scripts are public. Even LL can not claim ownership for the wiki scripts. LLs own veiwer code is public. People do expect the author to be credited, which is basic mannaers.

  • Thanks 1
Link to comment
Share on other sites

24 minutes ago, Estelle Pienaar said:

Also if you don't have the rights to a script, keep in mind that the author might take an issue with it being published.

If the script can be viewed (ie modify allowed) then I can't see that it is a violation because you are both allowed to see it and alter it. I don't know what happens when a script is modify but no-transfer, because the creator is saying "you can see this, but you can't give it to anybody else", in which case posting it might be deemed a breach? I'm sure better IANAL's than myself will comment.

Link to comment
Share on other sites

12 minutes ago, Profaitchikenz Haiku said:

If the script can be viewed (ie modify allowed) then I can't see that it is a violation because you are both allowed to see it and alter it. I don't know what happens when a script is modify but no-transfer, because the creator is saying "you can see this, but you can't give it to anybody else", in which case posting it might be deemed a breach? I'm sure better IANAL's than myself will comment.

It is a matter of principle. Basic decency if you wish a different version. But you can not breach any contract not signed.

Link to comment
Share on other sites

54 minutes ago, steph Arnott said:

LSL scripts are public. Even LL can not claim ownership for the wiki scripts. LLs own veiwer code is public. People do expect the author to be credited, which is basic mannaers.

Sourcecode that doesn't bear any licensing is assumed to have no license allowing you to use it legally. That's why license headers exist.

A license header specifies which rights are given to anyone finding this piece of code. No rights specified = no rights given.

SL Permissions do not override basic copyright law.

Edited by Kyrah Abattoir
Link to comment
Share on other sites

1 minute ago, Kyrah Abattoir said:

Sourcecode that doesn't bear any licensing is assumed to have no license allowing you to use it legally. That's why license headers exist.

SL Permissions do not override basic copyright law.

Suggest you study terms and conditions and also basic copywrite law.

Link to comment
Share on other sites

https://choosealicense.com/no-permission/

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.

Your options:

  • Ask the maintainers nicely to add a license. Unless the software includes strong indications to the contrary, lack of a license is probably an oversight. If the software is hosted on a site like GitHub, open an issue requesting a license and include a link to this site. If you’re bold and it’s fairly obvious what license is most appropriate, open a pull request to add a license – see “suggest this license” in the sidebar of the page for each license on this site (e.g., MIT).
  • Don’t use the software. Find or create an alternative that is under an open source license.
  • Negotiate a private license. Bring your lawyer
Link to comment
Share on other sites

4 minutes ago, Kyrah Abattoir said:

https://choosealicense.com/no-permission/

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.

Your options:

  • Ask the maintainers nicely to add a license. Unless the software includes strong indications to the contrary, lack of a license is probably an oversight. If the software is hosted on a site like GitHub, open an issue requesting a license and include a link to this site. If you’re bold and it’s fairly obvious what license is most appropriate, open a pull request to add a license – see “suggest this license” in the sidebar of the page for each license on this site (e.g., MIT).
  • Don’t use the software. Find or create an alternative that is under an open source license.
  • Negotiate a private license. Bring your lawyer

You can not licence library code that belong to a company. Also the terms and conditions of using Linden Labs library code clearly states it is their property. Every person using LSL agreed to that when they entered SL under terms of use.

Edited by steph Arnott
Link to comment
Share on other sites

 

12 minutes ago, steph Arnott said:

Suggest you study terms and conditions and also basic copywrite law.

 

8 minutes ago, Kyrah Abattoir said:

https://choosealicense.com/no-permission/

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.

Your options:

  • Ask the maintainers nicely to add a license. Unless the software includes strong indications to the contrary, lack of a license is probably an oversight. If the software is hosted on a site like GitHub, open an issue requesting a license and include a link to this site. If you’re bold and it’s fairly obvious what license is most appropriate, open a pull request to add a license – see “suggest this license” in the sidebar of the page for each license on this site (e.g., MIT).
  • Don’t use the software. Find or create an alternative that is under an open source license.
  • Negotiate a private license. Bring your lawyer

Local forum poster steph arnott gets assblasted by actual law!

4 minutes ago, steph Arnott said:

You can not licence library code that belong to a company. Also the terms and conditions of using Linden Labs library code clearly states it is their property. Every person using LSL agreed to that when they entered SL under terms of use.

LL is granted the rights to distribute yes to anything LEGITIMATELY uploaded by it's creator. That doesn't give YOU the rights.

 

Edited by Ghost Menjou
Link to comment
Share on other sites

1 minute ago, Ghost Menjou said:

 

 

Local forum poster steph arnott gets assblasted by actual law!

LL owns the rights to distribute yes to anything LEGITIMATELY uploaded by it's creator. That doesn't give YOU the rights.

 

You do not know law then. LL say a lot of bull but in court it would not even be heard. You can not claim copy write on library code published on the net. If you want to go bankrupt then be my guest and ty. I will step over you in slum street.

Link to comment
Share on other sites

2 minutes ago, steph Arnott said:

You do not know law then. LL say a lot of bull but in court it would not even be heard. You can not claim copy write on library code published on the net. If you want to go bankrupt then be my guest and ty. I will step over you in slum street.

https://www.quora.com/Have-any-commercial-companies-been-sued-for-abusing-open-source-software-so-far

It's not just companies either. They mostly go after companies, but if you say upload files to LL where terms don't allow it, IE: models. They have to respond to DMCA claims and the user uploading it can get sued by the copyright holder.

 

Edited by Ghost Menjou
Link to comment
Share on other sites

http://wiki.secondlife.com/wiki/Linden_Lab_Official:Terms_of_Service_FAQ#Do_I_retain_intellectual_property_rights_in_content_I_create_in_Second_Life.3F

Do I retain intellectual property rights in content I create in Second Life?

Yes, you retain the intellectual property rights you already have in content you submit to Second Life. This is in Section 7.1 of the Terms of Service.

Link to comment
Share on other sites

12 minutes ago, steph Arnott said:

You do not know law then. LL say a lot of bull but in court it would not even be heard. You can not claim copy write on library code published on the net. If you want to go bankrupt then be my guest and ty. I will step over you in slum street.

I am not a legal expert. But the code above has never been published in a wiki or code library and is therefore in my humble opinion no "library code".

Edited by Estelle Pienaar
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...