Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Auto-Update Scripts

Jeffronius Batra
Registered User
Join date: 27 Apr 2006
Posts: 18
09-28-2006 23:41
Let's say I want to build and sell objects that have scripts in them, and that I want to update the scripts in the objects I have already sold.

How is this typically done, and what are the best practices for creating self-updating scripts?
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
09-29-2006 01:05
I've been kinda currious about this myself.

It would seem to me the best way to have a script update itself would be to use an http request to connect to and download a new version.. But since scripts can't create objects such as other scripts, I'm at a complete loss as to how they do this.

Yet I have seen several objects on the slexchange that claim to have self-updating scripts.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-29-2006 01:22
I've not used it, to scared to try :), but

llRemoteLoadScriptPin is I think what you need.
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
09-29-2006 01:28
Nope.. couple reasons

quote from the page on that function
From: someone

If the owner of the object containing this script can modify the object identified by the key target, and if the pin matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script name will be copied into target.


Once sold, we no longer have the modify permission. This is used from the place containing the new script to copy it to the object that requires the new script.
From: someone

llRemoteLoadScriptPin only works if both prims are in the same sim.

Also won't work for this..
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
09-29-2006 01:32
The only other thing I could think of off hand.. and this.. um.. may or may not be a feasible way of doing it.. is to have the script written in php.. the entire script.. the only thing the script on the object does is pass info back and forth between the user and the php hosted somewhere else.

But with all of that communications going on.. I doubt that idea would work very well.
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
09-29-2006 02:07
With all of the items I have purchased that came with updates it wasn't just the script that was updated. I received another copy of the item with the new scripts in it, and just deleted the old copy. That way they get around the no mod restrictions.

I imagine they do this with the http commands in lsl. I think when the item is rezed it just checks with the creator's web site to see if a newer version is avail, and if one is, it then tells the site that I need a copy. I would presume that the site then tells an object in world to give me a new copy.

Something like SL Exchange uses would be my guess, but I have no idea what the actual code is.
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
09-29-2006 04:23
The other way it's often done... you distribute an "updater disc" or similar.

You make the object mod for the next owner. They own the the updater too and it all works.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Hugo Dalgleish
Registered User
Join date: 14 May 2006
Posts: 27
09-29-2006 08:05
Jumping back to the llRemoteLoadScriptPin question - is that fixed in the latest version, or is it still broken?
PattehPh0x Katsu
The Ph0x.
Join date: 27 Jun 2006
Posts: 50
09-29-2006 08:36
The way I do it, is using a server prim in SL, which contains the newest version. When an object I've sold is rezzed in world, it emails the server with it's version, if there's a newer version, the server gives it to the person with the older one.
Lexi Foley
Registered User
Join date: 1 Mar 2006
Posts: 43
yes but keep in mind
09-29-2006 12:34
From: PattehPh0x Katsu
The way I do it, is using a server prim in SL, which contains the newest version. When an object I've sold is rezzed in world, it emails the server with it's version, if there's a newer version, the server gives it to the person with the older one.


The UUID of an object, can change during updates from SL or other factors,,
So its not so reliable (ahem dutch sorry for spelling) if the key of the object changes the
sold objects wil nor be abel to email,, because it has a different key,, so then you need all to email all sold ojbects whit the new key,, but that changes every time they rez it or something,, so that is going to be hard,,
As i know of, there is no garantie, that the serverprim key stays the same!!!
It can work for a while maybe forever but like i say if you are willing to risk the autoupdates no be working annymore its a good choice,,

An option is to give the people a landmark where they should go to,,and then its easy to set an update system,, but that isnt you quistion you want a full auto update from annywhere!

For that i need to go testing what could be a good ,, and risk free ,, option.
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
09-29-2006 12:59
From: Jeffronius Batra
How is this typically done, and what are the best practices for creating self-updating scripts?

You can create separate 'update disc' -- item which is transferred to owner of thing with scripts about to be updated. The new owner of item can then rezz it, and it updates target object using the llRemoteLoad... functionality, as mentioned.

Some more detailed step-by-step procedures were discussed recently on SC forum. The thread is here:

http://forums.secondcitizen.com/showthread.php?t=1813

although not sure if its' possible to view it past 1st page without registering.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
09-30-2006 11:10
OK,

1) When item is rezzed it checks a http server for the address of the in-game prim update server.

2) Item emails server with item version and owner's key.

3)If item version is older than version server contains, new item is emailed to item owner.

Alternately,

1)Item contains a list of multiple servers, then each new item contains an updated list. This list contains several in world prim servers, for redundancy.
Albert Wake
Registered User
Join date: 5 Jan 2006
Posts: 25
12-11-2006 15:55
Thanks for those links and such everyone, I was expecting something a bit more user friendly, but oh well these will do : )
Scripter Ah
Registered User
Join date: 8 Dec 2006
Posts: 3
12-11-2006 17:16
Did you read everything on that link?

"
If you need to update scripts for your end users, consider putting the updated scripts inside of an object which is then delivered directly to end users via llGiveInventory. This object, if rezzed in the same sim as the item being updated, can then negotiate a PIN with the object and the scripts can be updated/enabled automatically.
-- DirtyMcLean
"