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 // All inventory offers made to Corrade can be processed for rejection // 4 // All inventory offers made to Corrade can be processed for rejection //
5 // approval by scripts. Corrade by default accepts inventory offers from // 5 // approval by scripts. Corrade by default accepts inventory offers from //
6 // masters defined in Corrade.ini - however, it would be useful to write // 6 // masters defined in Corrade.ini - however, it would be useful to write //
7 // an example script that takes a list of avatars and automatically // 7 // an example script that takes a list of avatars and automatically //
Line 10... Line 10...
10 // 10 //
11 // The script works in combination with a "configuration" notecard that // 11 // The script works in combination with a "configuration" notecard that //
12 // must be placed in the same primitive as this script. The purpose of // 12 // must be placed in the same primitive as this script. The purpose of //
13 // this script is to demonstrate accepting inventory offers with the // 13 // this script is to demonstrate accepting inventory offers with the //
14 // Corrade scripted agent and you are free to use, and commercialize it // 14 // Corrade scripted agent and you are free to use, and commercialize it //
15 // under the terms of the GNU/GPLv3 license which can be found at: // 15 // under the terms of the CC BY 2.0 license which can be found at: //
16 // http://www.gnu.org/licenses/gpl.html // 16 // https://creativecommons.org/licenses/by/2.0 //
17 /////////////////////////////////////////////////////////////////////////// 17 ///////////////////////////////////////////////////////////////////////////
Line 18... Line 18...
18   18  
19 /////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////
20 // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // 20 // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 //
21 /////////////////////////////////////////////////////////////////////////// 21 ///////////////////////////////////////////////////////////////////////////
22 string wasKeyValueGet(string k, string data) { 22 string wasKeyValueGet(string k, string data) {
23 if(llStringLength(data) == 0) return ""; 23 if(llStringLength(data) == 0) return "";
24 if(llStringLength(k) == 0) return ""; 24 if(llStringLength(k) == 0) return "";
Line 27... Line 27...
27 if(i != -1) return llList2String(a, i+1); 27 if(i != -1) return llList2String(a, i+1);
28 return ""; 28 return "";
29 } 29 }
Line 30... Line 30...
30 30
31 /////////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////////
32 // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // 32 // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 //
33 /////////////////////////////////////////////////////////////////////////// 33 ///////////////////////////////////////////////////////////////////////////
34 string wasKeyValueEncode(list data) { 34 string wasKeyValueEncode(list data) {
35 list k = llList2ListStrided(data, 0, -1, 2); 35 list k = llList2ListStrided(data, 0, -1, 2);
36 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); 36 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2);
Line 42... Line 42...
42 } while(llGetListLength(k) != 0); 42 } while(llGetListLength(k) != 0);
43 return llDumpList2String(data, "&"); 43 return llDumpList2String(data, "&");
44 } 44 }
Line 45... Line 45...
45   45  
46 /////////////////////////////////////////////////////////////////////////// 46 ///////////////////////////////////////////////////////////////////////////
47 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 47 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
48 /////////////////////////////////////////////////////////////////////////// 48 ///////////////////////////////////////////////////////////////////////////
49 // escapes a string in conformance with RFC1738 49 // escapes a string in conformance with RFC1738
50 string wasURLEscape(string i) { 50 string wasURLEscape(string i) {
51 string o = ""; 51 string o = "";
Line 66... Line 66...
66 } while(i != ""); 66 } while(i != "");
67 return o; 67 return o;
68 } 68 }
Line 69... Line 69...
69   69  
70 /////////////////////////////////////////////////////////////////////////// 70 ///////////////////////////////////////////////////////////////////////////
71 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 71 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
72 /////////////////////////////////////////////////////////////////////////// 72 ///////////////////////////////////////////////////////////////////////////
73 // unescapes a string in conformance with RFC1738 73 // unescapes a string in conformance with RFC1738
74 string wasURLUnescape(string i) { 74 string wasURLUnescape(string i) {
75 return llUnescapeURL( 75 return llUnescapeURL(
Line 90... Line 90...
90 ) 90 )
91 ); 91 );
92 } 92 }
Line 93... Line 93...
93   93  
94 /////////////////////////////////////////////////////////////////////////// 94 ///////////////////////////////////////////////////////////////////////////
95 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 95 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
96 /////////////////////////////////////////////////////////////////////////// 96 ///////////////////////////////////////////////////////////////////////////
97 list wasCSVToList(string csv) { 97 list wasCSVToList(string csv) {
98 list l = []; 98 list l = [];
99 list s = []; 99 list s = [];