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 project makes Corrade, the Second Life / OpenSim bot look at the 5 // This project makes Corrade, the Second Life / OpenSim bot look at the
6 // avatars typing in local chat. You can find more details about the bot 6 // avatars typing in local chat. You can find more details about the bot
7 // at the URL: http://grimore.org/secondlife/scripted_agents/corrade 7 // at the URL: http://grimore.org/secondlife/scripted_agents/corrade
8 // 8 //
9 // The script works in combination with a "configuration" notecard that 9 // The script works in combination with a "configuration" notecard that
10 // must be placed in the same primitive as this script. The purpose of this 10 // must be placed in the same primitive as this script. The purpose of this
11 // script is to show setting and disposing of viewer effects with Corrade 11 // script is to show setting and disposing of viewer effects with Corrade
12 // and you are free to use, change, and commercialize it under the terms 12 // and you are free to use, change, and commercialize it under 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(