corrade-lsl-templates – Diff between revs 5 and 29

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 5 Rev 29
Line 1... Line 1...
1 /////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // 2 // Copyright (C) Wizardry and Steamworks 2014 - License: CC BY 2.0 //
3 /////////////////////////////////////////////////////////////////////////// 3 ///////////////////////////////////////////////////////////////////////////
4 // 4 //
5 // This is a device that can be used to automatically batch-set the estate 5 // This is a device that can be used to automatically batch-set the estate
6 // covenant for regions using the Corrade scripted agent. You can find out 6 // covenant for regions using the Corrade scripted agent. You can find out
7 // more about Corrade by following the URL: 7 // more about Corrade by following the URL:
Line 11... Line 11...
11 // "regions" notecard and a "covenant" notecard that must all be placed in 11 // "regions" notecard and a "covenant" notecard that must all be placed in
12 // the same primitive as this script. 12 // the same primitive as this script.
13 // 13 //
14 // The purpose of this script is to demonstrate batch-setting the estate 14 // The purpose of this script is to demonstrate batch-setting the estate
15 // covenant with Corrade and you are free to use, change, and commercialize 15 // covenant with Corrade and you are free to use, change, and commercialize
16 // it under the GNU/GPLv3 16 // it under the CC BY 2.0
17 // license at: http://www.gnu.org/licenses/gpl.html 17 // license at: https://creativecommons.org/licenses/by/2.0
18 // 18 //
19 /////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////
Line 20... Line 20...
20   20  
21 /////////////////////////////////////////////////////////////////////////// 21 ///////////////////////////////////////////////////////////////////////////
22 // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // 22 // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 //
23 /////////////////////////////////////////////////////////////////////////// 23 ///////////////////////////////////////////////////////////////////////////
24 string wasProgress(integer percent, integer length, list symbols) { 24 string wasProgress(integer percent, integer length, list symbols) {
25 percent /= (integer)((float)100.0/(length)); 25 percent /= (integer)((float)100.0/(length));
26 string p = llList2String(symbols,0); 26 string p = llList2String(symbols,0);
Line 31... Line 31...
31 } while(++itra<length); 31 } while(++itra<length);
32 return p + llList2String(symbols,3); 32 return p + llList2String(symbols,3);
33 } 33 }
Line 34... Line 34...
34   34  
35 /////////////////////////////////////////////////////////////////////////// 35 ///////////////////////////////////////////////////////////////////////////
36 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 36 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
37 /////////////////////////////////////////////////////////////////////////// 37 ///////////////////////////////////////////////////////////////////////////
38 string wasKeyValueGet(string k, string data) { 38 string wasKeyValueGet(string k, string data) {
39 if(llStringLength(data) == 0) return ""; 39 if(llStringLength(data) == 0) return "";
40 if(llStringLength(k) == 0) return ""; 40 if(llStringLength(k) == 0) return "";
Line 43... Line 43...
43 if(i != -1) return llList2String(a, 2*i+1); 43 if(i != -1) return llList2String(a, 2*i+1);
44 return ""; 44 return "";
45 } 45 }
Line 46... Line 46...
46 46
47 /////////////////////////////////////////////////////////////////////////// 47 ///////////////////////////////////////////////////////////////////////////
48 // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // 48 // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 //
49 /////////////////////////////////////////////////////////////////////////// 49 ///////////////////////////////////////////////////////////////////////////
50 string wasKeyValueEncode(list data) { 50 string wasKeyValueEncode(list data) {
51 list k = llList2ListStrided(data, 0, -1, 2); 51 list k = llList2ListStrided(data, 0, -1, 2);
52 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); 52 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2);
Line 58... Line 58...
58 } while(llGetListLength(k) != 0); 58 } while(llGetListLength(k) != 0);
59 return llDumpList2String(data, "&"); 59 return llDumpList2String(data, "&");
60 } 60 }
Line 61... Line 61...
61   61  
62 /////////////////////////////////////////////////////////////////////////// 62 ///////////////////////////////////////////////////////////////////////////
63 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 63 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
64 /////////////////////////////////////////////////////////////////////////// 64 ///////////////////////////////////////////////////////////////////////////
65 // escapes a string in conformance with RFC1738 65 // escapes a string in conformance with RFC1738
66 string wasURLEscape(string i) { 66 string wasURLEscape(string i) {
67 string o = ""; 67 string o = "";
Line 82... Line 82...
82 } while(i != ""); 82 } while(i != "");
83 return o; 83 return o;
84 } 84 }
Line 85... Line 85...
85   85  
86 /////////////////////////////////////////////////////////////////////////// 86 ///////////////////////////////////////////////////////////////////////////
87 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 87 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
88 /////////////////////////////////////////////////////////////////////////// 88 ///////////////////////////////////////////////////////////////////////////
89 string wasListToCSV(list l) { 89 string wasListToCSV(list l) {
90 list v = []; 90 list v = [];
91 do { 91 do {
Line 107... Line 107...
107 } while(l != []); 107 } while(l != []);
108 return llDumpList2String(v, ","); 108 return llDumpList2String(v, ",");
109 } 109 }
Line 110... Line 110...
110   110  
111 /////////////////////////////////////////////////////////////////////////// 111 ///////////////////////////////////////////////////////////////////////////
112 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 112 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
113 /////////////////////////////////////////////////////////////////////////// 113 ///////////////////////////////////////////////////////////////////////////
114 list wasCSVToList(string csv) { 114 list wasCSVToList(string csv) {
115 list l = []; 115 list l = [];
116 list s = []; 116 list s = [];
Line 146... Line 146...
146 // invariant: length(s) = 0 146 // invariant: length(s) = 0
147 return l + m; 147 return l + m;
148 } 148 }
Line 149... Line 149...
149   149  
150 /////////////////////////////////////////////////////////////////////////// 150 ///////////////////////////////////////////////////////////////////////////
151 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 151 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
152 /////////////////////////////////////////////////////////////////////////// 152 ///////////////////////////////////////////////////////////////////////////
153 // unescapes a string in conformance with RFC1738 153 // unescapes a string in conformance with RFC1738
154 string wasURLUnescape(string i) { 154 string wasURLUnescape(string i) {
155 return llUnescapeURL( 155 return llUnescapeURL(