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 an automatic teleporter, sitter and animator for the Corrade 5 // This is an automatic teleporter, sitter and animator for the Corrade
6 // Second Life / OpenSim bot. You can find more details about the bot 6 // Second Life / OpenSim bot. You can find more details about the bot
7 // by following the URL: http://was.fm/secondlife/scripted_agents/corrade 7 // by following the URL: http://was.fm/secondlife/scripted_agents/corrade
8 // 8 //
9 // The sit script works together with a "configuration" notecard and an 9 // The sit script works together with a "configuration" notecard and an
10 // animation that must both be placed in the same primitive as this script. 10 // animation that must both be placed in the same primitive as this script.
11 // The purpose of this script is to demonstrate sitting with Corrade and 11 // The purpose of this script is to demonstrate sitting with Corrade and
12 // you are free to use, change, and commercialize it under the GNU/GPLv3 12 // you are free to use, change, and commercialize it under the CC BY 2.0
13 // license at: http://www.gnu.org/licenses/gpl.html 13 // license at: https://creativecommons.org/licenses/by/2.0
14 // 14 //
15 /////////////////////////////////////////////////////////////////////////// 15 ///////////////////////////////////////////////////////////////////////////
Line 16... Line 16...
16   16  
17 /////////////////////////////////////////////////////////////////////////// 17 ///////////////////////////////////////////////////////////////////////////
18 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 18 // Copyright (C) 2015 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, 2*i+1); 25 if(i != -1) return llList2String(a, 2*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) 2011 Wizardry and Steamworks - License: GNU GPLv3 // 45 // Copyright (C) 2011 Wizardry and Steamworks - License: CC BY 2.0 //
46 /////////////////////////////////////////////////////////////////////////// 46 ///////////////////////////////////////////////////////////////////////////
47 vector wasCirclePoint(float radius) { 47 vector wasCirclePoint(float radius) {
48 float x = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); 48 float x = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2);
49 float y = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); 49 float y = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2);
50 if(llPow(x,2) + llPow(y,2) <= llPow(radius,2)) 50 if(llPow(x,2) + llPow(y,2) <= llPow(radius,2))
51 return <x, y, 0>; 51 return <x, y, 0>;
52 return wasCirclePoint(radius); 52 return wasCirclePoint(radius);
Line 53... Line 53...
53 } 53 }
54   54  
55 /////////////////////////////////////////////////////////////////////////// 55 ///////////////////////////////////////////////////////////////////////////
56 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // 56 // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 //
57 /////////////////////////////////////////////////////////////////////////// 57 ///////////////////////////////////////////////////////////////////////////
58 // escapes a string in conformance with RFC1738 58 // escapes a string in conformance with RFC1738
59 string wasURLEscape(string i) { 59 string wasURLEscape(string i) {