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 script that uses the Corrade Second Life / OpenSim bot which 5 // This is a script that uses the Corrade Second Life / OpenSim bot which
6 // is able to detect the gender of avatar shapes. You can find more details 6 // is able to detect the gender of avatar shapes. You can find more details
7 // about Corrade at: http://grimore.org/secondlife/scripted_agents/corrade 7 // about Corrade at: http://grimore.org/secondlife/scripted_agents/corrade
8 // 8 //
9 // This script works together with a "configuration" notecard that must be 9 // This script works together with a "configuration" notecard that must be
10 // placed in the same primitive as this script. The purpose of this script 10 // placed in the same primitive as this script. The purpose of this script
11 // is to demonstrate detecting avatar genders with Corrade and you are free 11 // is to demonstrate detecting avatar genders with Corrade and you are free
12 // to use, change, and commercialize it provided that you follow the terms 12 // to use, change, and commercialize it provided that you follow the terms
13 // of the GNU/GPLv3 license at: http://www.gnu.org/licenses/gpl.html 13 // of the CC BY 2.0 license at: https://creativecommons.org/licenses/by/2.0
14 // 14 //
15 /////////////////////////////////////////////////////////////////////////// 15 ///////////////////////////////////////////////////////////////////////////
Line 16... Line 16...
16   16  
17 /////////////////////////////////////////////////////////////////////////// 17 ///////////////////////////////////////////////////////////////////////////
18 // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // 18 // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 //
19 /////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////
20 string wasKeyValueGet(string k, string data) { 20 string wasKeyValueGet(string k, string data) {
21 if(llStringLength(data) == 0) return ""; 21 if(llStringLength(data) == 0) return "";
22 if(llStringLength(k) == 0) return ""; 22 if(llStringLength(k) == 0) return "";
Line 25... Line 25...
25 if(i != -1) return llList2String(a, i+1); 25 if(i != -1) return llList2String(a, i+1);
26 return ""; 26 return "";
27 } 27 }
Line 28... Line 28...
28 28
29 /////////////////////////////////////////////////////////////////////////// 29 ///////////////////////////////////////////////////////////////////////////
30 // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // 30 // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 //
31 /////////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////////
32 string wasKeyValueEncode(list data) { 32 string wasKeyValueEncode(list data) {
33 list k = llList2ListStrided(data, 0, -1, 2); 33 list k = llList2ListStrided(data, 0, -1, 2);
34 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); 34 list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2);
Line 40... Line 40...
40 } while(llGetListLength(k) != 0); 40 } while(llGetListLength(k) != 0);
41 return llDumpList2String(data, "&"); 41 return llDumpList2String(data, "&");
42 } 42 }
Line 43... Line 43...
43   43  
44 /////////////////////////////////////////////////////////////////////////// 44 ///////////////////////////////////////////////////////////////////////////
45 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 45 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
46 /////////////////////////////////////////////////////////////////////////// 46 ///////////////////////////////////////////////////////////////////////////
47 // escapes a string in conformance with RFC1738 47 // escapes a string in conformance with RFC1738
48 string wasURLEscape(string i) { 48 string wasURLEscape(string i) {
49 string o = ""; 49 string o = "";
Line 64... Line 64...
64 } while(i != ""); 64 } while(i != "");
65 return o; 65 return o;
66 } 66 }
Line 67... Line 67...
67   67  
68 /////////////////////////////////////////////////////////////////////////// 68 ///////////////////////////////////////////////////////////////////////////
69 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 69 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
70 /////////////////////////////////////////////////////////////////////////// 70 ///////////////////////////////////////////////////////////////////////////
71 // unescapes a string in conformance with RFC1738 71 // unescapes a string in conformance with RFC1738
72 string wasURLUnescape(string i) { 72 string wasURLUnescape(string i) {
73 return llUnescapeURL( 73 return llUnescapeURL(
Line 88... Line 88...
88 ) 88 )
89 ); 89 );
90 } 90 }
Line 91... Line 91...
91   91  
92 /////////////////////////////////////////////////////////////////////////// 92 ///////////////////////////////////////////////////////////////////////////
93 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 93 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
94 /////////////////////////////////////////////////////////////////////////// 94 ///////////////////////////////////////////////////////////////////////////
95 list wasCSVToList(string csv) { 95 list wasCSVToList(string csv) {
96 list l = []; 96 list l = [];
97 list s = []; 97 list s = [];
Line 127... Line 127...
127 // postcondition: length(s) = 0 127 // postcondition: length(s) = 0
128 return l + m; 128 return l + m;
129 } 129 }
Line 130... Line 130...
130   130  
131 /////////////////////////////////////////////////////////////////////////// 131 ///////////////////////////////////////////////////////////////////////////
132 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 132 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
133 /////////////////////////////////////////////////////////////////////////// 133 ///////////////////////////////////////////////////////////////////////////
134 string wasListToCSV(list l) { 134 string wasListToCSV(list l) {
135 list v = []; 135 list v = [];
136 do { 136 do {