aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/ScriptEngines/Default.lsl
diff options
context:
space:
mode:
authorBrian McBee2007-08-18 02:15:21 +0000
committerBrian McBee2007-08-18 02:15:21 +0000
commit8eb9952e5ff5c003a98168e7847f309e51f48645 (patch)
tree0ed4e9c95788df7b97428816b459beece0eb0726 /bin/ScriptEngines/Default.lsl
parent* Applied dalien's terrain help patch (thanks!) (diff)
downloadopensim-SC_OLD-8eb9952e5ff5c003a98168e7847f309e51f48645.zip
opensim-SC_OLD-8eb9952e5ff5c003a98168e7847f309e51f48645.tar.gz
opensim-SC_OLD-8eb9952e5ff5c003a98168e7847f309e51f48645.tar.bz2
opensim-SC_OLD-8eb9952e5ff5c003a98168e7847f309e51f48645.tar.xz
lsl test cases, and llregioncorner (thanks Dalien!)
Diffstat (limited to 'bin/ScriptEngines/Default.lsl')
-rw-r--r--bin/ScriptEngines/Default.lsl35
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/ScriptEngines/Default.lsl b/bin/ScriptEngines/Default.lsl
index 6e362f8..51f6ca5 100644
--- a/bin/ScriptEngines/Default.lsl
+++ b/bin/ScriptEngines/Default.lsl
@@ -1,4 +1,12 @@
1integer touch_count = 0; 1integer touch_count = 0;
2
3to_integer(float num)
4{
5 llSay(0, num + " floor: " + llFloor(num));
6 llSay(0, num + " ceiling: " + llCeil(num));
7 llSay(0, num + " round: " + llRound(num));
8}
9
2default { 10default {
3 state_entry() 11 state_entry()
4 { 12 {
@@ -7,6 +15,33 @@ default {
7 15
8 touch_start(integer total_number) 16 touch_start(integer total_number)
9 { 17 {
18 float angle45 = PI/4.0; // 45 degrees
19 float angle30 = PI/6.0; // 30 degrees
20 float sqrt2 = llSqrt(2.0);
21 float deltaCos = llCos(angle45) - sqrt2/2.0;
22 float deltaSin = llSin(angle30) - 0.5;
23 float deltaAtan = llAtan2(1, 1)*4 - PI;
24 float deltaTan = llTan(PI);
25 llSay(0, "deltaSin: " + deltaSin);
26 llShout(0, "deltaCos: " + deltaCos);
27 llWhisper(0, "deltaTan: " + deltaTan);
28 llWhisper(0, "deltaAtan: " + deltaAtan);
29 llSay(0, "Fabs(power(2^16)): " + llFabs(0-llPow(2, 16)));
30 llSay(0, "Abs(-1): " + llAbs(-1));
31 llSay(0, "One random(100): " + llFrand(100));
32 llSay(0, "Two random(100): " + llFrand(100));
33 llSay(0, "Three random(100): " + llFrand(100));
34 llSay(0, "Four random(100.0): " + llFrand(100.0));
35 llWhisper(0, "The unix time is: " + llGetUnixTime());
36 to_integer(2.4);
37 to_integer(2.5);
38 to_integer(2.6);
39 to_integer(3.51);
40 llSay(0, "Should be 112abd47ceaae1c05a826828650434a6: " + llMD5String("Hello, Avatar!", 0));
41 llSay(0, "Should be 9: " +llModPow(2, 16, 37));
42 llSay(0, "Region corner: " + (string)llGetRegionCorner());
43 llSetText("This is a text", <1,0,0>, 1);
44
10 touch_count++; 45 touch_count++;
11 llSay(0, "Object was touched. Touch count: " + touch_count); 46 llSay(0, "Object was touched. Touch count: " + touch_count);
12 } 47 }