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 2016 - License: GNU GPLv3 // 2 // Copyright (C) Wizardry and Steamworks 2016 - License: CC BY 2.0 //
3 /////////////////////////////////////////////////////////////////////////// 3 ///////////////////////////////////////////////////////////////////////////
4 // 4 //
5 // This script is a message relay for Corrade that listens for local, group 5 // This script is a message relay for Corrade that listens for local, group
6 // and instant messages. The script binds to Corrade's local, message and 6 // and instant messages. The script binds to Corrade's local, message and
7 // group notification and then any message received by Corrade gets sent 7 // group notification and then any message received by Corrade gets sent
Line 11... Line 11...
11 // http://grimore.org/secondlife/scripted_agents/corrade 11 // http://grimore.org/secondlife/scripted_agents/corrade
12 // 12 //
13 /////////////////////////////////////////////////////////////////////////// 13 ///////////////////////////////////////////////////////////////////////////
Line 14... Line 14...
14   14  
15 /////////////////////////////////////////////////////////////////////////// 15 ///////////////////////////////////////////////////////////////////////////
16 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 16 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
17 /////////////////////////////////////////////////////////////////////////// 17 ///////////////////////////////////////////////////////////////////////////
18 string wasKeyValueGet(string k, string data) { 18 string wasKeyValueGet(string k, string data) {
19 if(llStringLength(data) == 0) return ""; 19 if(llStringLength(data) == 0) return "";
20 if(llStringLength(k) == 0) return ""; 20 if(llStringLength(k) == 0) return "";
Line 23... Line 23...
23 if(i != -1) return llList2String(a, 2*i+1); 23 if(i != -1) return llList2String(a, 2*i+1);
24 return ""; 24 return "";
25 } 25 }
Line 26... Line 26...
26 26
27 /////////////////////////////////////////////////////////////////////////// 27 ///////////////////////////////////////////////////////////////////////////
28 // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // 28 // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 //
29 /////////////////////////////////////////////////////////////////////////// 29 ///////////////////////////////////////////////////////////////////////////
30 string wasKeyValueEncode(list data) { 30 string wasKeyValueEncode(list data) {
31 list k = llList2ListStrided(data, 0, -1, 2); 31 list k = llList2ListStrided(data, 0, -1, 2);
32 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); 32 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2);
Line 38... Line 38...
38 } while(llGetListLength(k) != 0); 38 } while(llGetListLength(k) != 0);
39 return llDumpList2String(data, "&"); 39 return llDumpList2String(data, "&");
40 } 40 }
Line 41... Line 41...
41   41  
42 /////////////////////////////////////////////////////////////////////////// 42 ///////////////////////////////////////////////////////////////////////////
43 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 43 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
44 /////////////////////////////////////////////////////////////////////////// 44 ///////////////////////////////////////////////////////////////////////////
45 // escapes a string in conformance with RFC1738 45 // escapes a string in conformance with RFC1738
46 string wasURLEscape(string i) { 46 string wasURLEscape(string i) {
47 string o = ""; 47 string o = "";
Line 62... Line 62...
62 } while(i != ""); 62 } while(i != "");
63 return o; 63 return o;
64 } 64 }
Line 65... Line 65...
65   65  
66 /////////////////////////////////////////////////////////////////////////// 66 ///////////////////////////////////////////////////////////////////////////
67 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 67 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
68 /////////////////////////////////////////////////////////////////////////// 68 ///////////////////////////////////////////////////////////////////////////
69 list wasCSVToList(string csv) { 69 list wasCSVToList(string csv) {
70 list l = []; 70 list l = [];
71 list s = []; 71 list s = [];
Line 101... Line 101...
101 // postcondition: length(s) = 0 101 // postcondition: length(s) = 0
102 return l + m; 102 return l + m;
103 } 103 }
Line 104... Line 104...
104   104  
105 /////////////////////////////////////////////////////////////////////////// 105 ///////////////////////////////////////////////////////////////////////////
106 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 106 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
107 /////////////////////////////////////////////////////////////////////////// 107 ///////////////////////////////////////////////////////////////////////////
108 string wasListToCSV(list l) { 108 string wasListToCSV(list l) {
109 list v = []; 109 list v = [];
110 do { 110 do {
Line 130... Line 130...
130 } while(l != []); 130 } while(l != []);
131 return llDumpList2String(v, ","); 131 return llDumpList2String(v, ",");
132 } 132 }
Line 133... Line 133...
133   133  
134 /////////////////////////////////////////////////////////////////////////// 134 ///////////////////////////////////////////////////////////////////////////
135 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 135 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
136 /////////////////////////////////////////////////////////////////////////// 136 ///////////////////////////////////////////////////////////////////////////
137 // unescapes a string in conformance with RFC1738 137 // unescapes a string in conformance with RFC1738
138 string wasURLUnescape(string i) { 138 string wasURLUnescape(string i) {
139 return llUnescapeURL( 139 return llUnescapeURL(