Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Updater Script Updater  

Script Updater

Remote prim updater for scripts. This registers the prim to accept scripts from a server in the same region.

Category: Updater
By : Ferd Frederix
Created: 2014-01-30 Edited: 2014-01-31
Worlds: Second Life

the Zip file

Download all files for Script Updater
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. AScript.lsl
Get file # 2. UpdaterClient.lsl
Get file # 3. AScript.lsl
Get file # 4. UpdaterServer.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2 // when anything changes in the prims inventory, this sends the name and UUID to a central server.
3 // It enabled remote script loading from that central prim, estate-wide
4 // As a result, if you add any new scripts, they auto-get inserted into the database
5 // tunable
6
7 integer debug = FALSE; // chat a message
8 integer UNIQ = 1246; // the private channel unique to the owner of this prim
9
10 // Not tuneable
11 integer CHECKIN = 86400; // 86400 seconds = 1 day
12 integer comChannel ; // placeholder for llRegionSay
13 DEBUG (string msg) { if(debug) llOwnerSay(llGetScriptName() + ":" + msg);}
14 integer pin; // a random pin for security
15
16 update() {
17
19 integer i;
20 for (i = 0; i < j; i++)
21 {
23 DEBUG("Sending " + name);
24 llRegionSay(comChannel,name + "^" + (string) pin);
25 }
26 llOwnerSay("Script Updater ready");
27 llSetTimerEvent(CHECKIN); // Hourly check ins
28 }
29
30
31 default
32 {
34 {
35 pin = llCeil(llFrand(123456) + 654321);
36 comChannel = (((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF ) + UNIQ; // 1234 is the private channel for this owner
38 update();
39
40 }
41 // in case we rez, our UUID changed, so we check in
42 on_rez(integer p) {
43 llResetScript(); }
44
45 // a new script may have been added
46 changed ( integer what)
47 {
48 if(what & CHANGED_INVENTORY ) {
49 update();
50 }
51 if(what & CHANGED_REGION_START ) {
53 }
54 }
55
56 timer()
57 {
58 update();
59 }
60
61 }

Script Updater

Test script for the updater

Category: Updater
By : Ferd Frederix
Created: 2014-01-30 Edited: 2014-01-31
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 integer Rev = 1;
2
3
4 default
5 {
7 {
8 llSay(0, "Hello, Avatar, my rev is " + (string) Rev);
9 }
10 touch_start(integer total_number)
11 {
12 llSay(0, "Hello, Avatar, my rev is " + (string) Rev);
13 }
14 }

Script Updater

Test script for the updater

Category: Updater
By : Ferd Frederix
Created: 2014-01-30 Edited: 2014-01-31
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 integer Rev = 2;
2
3
4 default
5 {
7 {
8 llSay(0, "Hello, Avatar, my rev is " + (string) Rev);
9 }
10 touch_start(integer total_number)
11 {
12 llSay(0, "Hello, Avatar, my rev is " + (string) Rev);
13 }
14 }

Script Updater

Central prim updater for scripts. Just drop a (non running) script in here and click the prim. Scripts are sent to the registered clients

Category: Updater
By : Ferd Frederix
Created: 2014-01-30 Edited: 2014-01-31
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2 // Rev 1.1 on 2-13-2014 fixes timeout bugs, adds
3 //
4
5
6 integer debug = TRUE; // chat a message
7
8 // tunables
9 integer TITLE = TRUE; // show how many scripts can be updated in hover text
10 integer UNIQ = 1246; // the private channel unique to the owner of this prim - MUST MATCH in client and server
11 integer CHECKIN = 172860; // 86400 seconds = 1 day X 2 + 60. This is twice the client setting plus one minute to allow for a dropped packet and slop in LSLEditor
12
13 // globals
14 integer comChannel ; // we listen on this channel. It is unioque to this owner and a subchannel
15 integer MINUTE = 60; // seconds in a minute, seems inefficient, but debug is a lot faster this way!
16
17 DEBUG (string msg) { if(debug) llSay(0,llGetScriptName() + ":" + msg);}
18
19 // The list is a PIN to update, a timestamp, thre name of the script, the UUID of the prim it was found in
20 // This is a small searchable database whose primary key (uniq) is name + UUID
21 integer STRIDE = 4; // size of this list:
22 list lScripts; // +0 (integer) PIN - remote prims random PIN
23 // +1 (integer) time stamp last heard from
24 // +2 (string) name of script
25 // +3 (key) UUID
26
27 update()
28 {
29 integer toDo = llGetInventoryNumber(INVENTORY_SCRIPT); // how many scripts checked in?
30 integer PrimToDo = llGetListLength(lScripts);
31
32 llOwnerSay((string) (toDo -1) + " scripts in inventory to send");
33 // DEBUG(llDumpList2String(lScripts,","));
34
35 integer index;
36
37 // scan all scripts in our inventory, could be more than one needs updating.
38 for (index = 0; index < toDo; index++)
39 {
41
42
43 // check to see if the name of the script we just found in our inventory matches ourself. if so, skip it
44
45 if(name != llGetScriptName()) {
46 DEBUG( "Processing script " + name);
47 integer countAllScripts = llGetListLength(lScripts);
48
49 integer indexer;
50 integer counter;
51 // Scan over all scripts
52 for (indexer = 0; indexer < countAllScripts; indexer += STRIDE)
53 {
54 // check to see if the name of the script we just found in our inventory matches any item in the list
55 if(llList2String(lScripts,indexer + 2) == name) {
56
57 key targetUUID = llList2Key(lScripts,indexer + 3); // yup, the name matches, lets fetch the UUID
58 integer pin = llList2Integer(lScripts,indexer ); // get the pin
59 DEBUG("Sending " + name + " PIN:" + (string) pin + " UUID:" + (string) targetUUID);
60 llRemoteLoadScriptPin(targetUUID,name,pin, TRUE,0); // and send it set to run
61 counter++;
62 }
63 }
64 DEBUG("Updated " + (string) counter + " scripts named " + name);
65 }
66 }
67 llOwnerSay("Done!");
68
69 }
70
71 default
72 {
74 {
75 if(! TITLE) {
76 llSetText("",<1,1,1>,1.0);
77 }
78
79 // make a private chat channel
80 comChannel = (((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF ) + UNIQ; // UNIQ is the private channel for this owner
81 llListen(comChannel,"","","");
82 llOwnerSay("Put non-running scripts into inventory and touch this to send them to remote prims.");
83 llSetTimerEvent(CHECKIN);
84 }
85
86 listen(integer channel, string name, key id, string msg)
87 {
88 list params = llParseString2List(msg,["^"],[]);
89 string message = llList2String(params,0);
90 integer pin = (integer) llList2String(params,1);
91
92 integer index;
93 integer len = llGetListLength(lScripts);
94 integer found = FALSE;
95
96 // CRU of CRUD process
97 // try to find a script in that prim previously recorded. If found update
98 for ( index = 0; index < len; index += STRIDE) {
99 // primary key is composite of UUID of prim and script name
100 if(llList2String(lScripts,index+2) == message && llList2Key(lScripts,index+3) == id) {
101 // found a prim and script that has already checked in.
102 DEBUG("Located script " + llList2String(lScripts,index+2));
103 lScripts = llListReplaceList([pin,llGetUnixTime(),message,pin],lScripts,index,index+3);
104 found = TRUE;
105 index = len; // skip to end
106 }
107 }
108
109 if(!found) {
110
111 DEBUG("Adding script " + message);
112 lScripts += pin; // the remote prim pin
113 lScripts += llGetUnixTime(); // time stamp it
114 lScripts += message; // remote prim name
115 lScripts += id; // remote prim UUID
116 }
117 }
118
119 touch_start( integer what)
120 {
121 if(llDetectedKey(0) == llGetOwner()) {
122 update();
123 }
124 }
125
126 // D of CRUD process
127 // scan for missing checked-in prims and clean up the list
128 timer()
129 {
130 integer len = llGetListLength(lScripts);
131
132 while(len > 0)
133 {
134 // look for late checkins, which means a script was stopped or a prim removed.
135 // Every day or two plus a minute for message delays is good to prevent RAM from filling up,
136 /// and still allows allows one missed message
137
138 integer timeago = llGetUnixTime() - llList2Integer(lScripts,len-STRIDE);
139 DEBUG("Timeago " + (string) timeago);
140
141 if( timeago > (CHECKIN*2 + MINUTE))
142 {
143 DEBUG("Have not heard from script named " + llList2String(lScripts,len-2) + ": Script named " + llKey2Name(llList2Key(lScripts,len-1)) );
144 lScripts = llDeleteSubList(lScripts,len-STRIDE,len);
145 len = llGetListLength(lScripts);
146 } else
147 len -= 3;
148 }
149
150 len = llGetListLength(lScripts);
151 if(TITLE) {
152 llSetText((string) (len/3) + " scripts",<1,1,1>,1.0);
153 }
154 }
155
156
157
158
159
160 }

Back to the Best Free Tools in Second Life and OpenSim.