Posts

Showing posts with the label LSL

About the death and rebirth of my auto greeter

 One of the peculiarities of lsl scripts is that like any other programming language, they evolve over time. Inevitably some very old things can stop working properly. An example is an automated greeter that sends a welcome message to all visitors. Additionally it also maintains a list with the last 100 visitors. Since I built it in 2007 or 2008 I have never sold more than 5 or 6. One of the reasons is that there is one that is free and uses an external LAMP server (Linux + Apache + MySql + PHP) or similar. It is also true that I must have updated it a few times since then. Other scripters even having the competition of the free greeter have considerably improved their scripts by adding other features that the free greeter does not have. I have recently observed that my automated greeter is not working properly when click the option to list the last 100 visitors. It only shows the first 64 in the list, then it stops. At first I did not know how to diagnose what was happening. ...

Linksets in SecondLife (2)

Before approaching the script to make links securely while maintaining the original order, I will explain a trick to do it without scripts . Rez the object you want to add and link it to a newly created primitive. Link the target object (for example the car) to the newly created object. Unlink the root prim, that is, the primitive you just created. And that's all. If you have experimented with the LinkSpy.lsl script on all primitives you will see that the order is correct. Using the script that I created the instructions are a bit more complex, there are six steps instead of three. Put the JJReLink script in the inventory of object. Click the object. Object will ask for link permissions. click on Yes Link object you can add to linkset. (Ctrl + L) Click on object again. Remove JJReLink script and check that everything is working Warning: This script to work temporarily breaks all links. Make sure your object is not physical before use, or all parts...

Linksets in SecondLife (1)

Image
Suppose you have a nice car that you got for free at a freebie store. Your car has all the permissions, it is copyable, modifiable and you can transfer it to another avatar. You decide that you can improve it, adding other objects that you have found for free. Perhaps you like to put on the hood a skull with horns and a spare wheel at the rear and to give it a more "MadMax" look like metal window grilles. By doing so, you discover that your brand new car has stopped working. Maybe instead of turning the wheels, the seats turn, the lights are no longer on, and the particle emitters are wrong.   Many scripts assume that a primitive within the primitive set will always have the same binding number, and when primitives are added or removed the script crashes. I'm going to create a few scripts to see what exactly is going on. Script: LinkSpy.lsl PutTextInfo ( ) { string sMessage = " Link: " + ( string ) llGetLinkNumber ( ) + " \n ...

Reading headers in a PHP script

When an http request is made from a script within a secondlife to an external web server, the simulator adds some headers such as X-Secondlife-Shard or X-Secondlife-Owner-Key. In this way I save the work of having to send that data in the POST. There are many examples doing a few searches. One of the most popular codes uses a huge "if" to distinguish when the variables arrive in Apache form or arrive entirely in uppercase with the prefix "HTTP_". I distrust that solution for being Spaghetti code. Another more elegant solution reimplements the apache_request_headers () function by checking before it does not exist. Only one problem, in my environment it does not work. This function is implemented but the headers from secondlife are in uppercase format. Finally I had to create my own version. I include the code of two PHP scripts and an lsl script. File: slHeaders.php    The following file is included as is on the web server < ? PHP class SlData ...