aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/assets/ScriptsAssetSet/KanEd-Test03.lsl
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-12 18:00:46 +0000
committerJustin Clarke Casey2009-01-12 18:00:46 +0000
commitfb8faa8336ddb795ccd6840259b06a2608350a57 (patch)
tree1f4977b9918d416602af88709e15aecf9499b969 /bin/assets/ScriptsAssetSet/KanEd-Test03.lsl
parent* Remove FunSLUDP code since this has moved to http://forge.opensimulator.org... (diff)
downloadopensim-SC_OLD-fb8faa8336ddb795ccd6840259b06a2608350a57.zip
opensim-SC_OLD-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.gz
opensim-SC_OLD-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.bz2
opensim-SC_OLD-fb8faa8336ddb795ccd6840259b06a2608350a57.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2913
* Add the KanEd scripts to the standard library * Thanks Fly-Man-
Diffstat (limited to 'bin/assets/ScriptsAssetSet/KanEd-Test03.lsl')
-rw-r--r--bin/assets/ScriptsAssetSet/KanEd-Test03.lsl49
1 files changed, 49 insertions, 0 deletions
diff --git a/bin/assets/ScriptsAssetSet/KanEd-Test03.lsl b/bin/assets/ScriptsAssetSet/KanEd-Test03.lsl
new file mode 100644
index 0000000..f371ee9
--- /dev/null
+++ b/bin/assets/ScriptsAssetSet/KanEd-Test03.lsl
@@ -0,0 +1,49 @@
1integer counter;
2integer second;
3
4default
5{
6 state_entry()
7 {
8 llSay( 0, "Hello, Avatar! Touch to change color and size.");
9 counter = 0;
10 }
11
12 touch_start(integer total_number)
13 {
14 counter = counter + 1;
15
16 llSay( 0, "Touched by angel number " + (string)counter);
17
18 llSetTimerEvent( 2 ); // create a "timer event" every 2 seconds.
19 }
20
21 timer() // do these instructions every time the timer event occurs.
22 {
23 second++;
24
25 // choose three random RGB color components between 0. and 1.0.
26 float red = llFrand( 1.0 );
27 float green = llFrand( 1.0 );
28 float blue = llFrand( 1.0 );
29
30 // combine color components into a vector and use that vector
31 // to set object color.
32 vector prim_color = < red, green, blue >;
33 llSetColor( prim_color, ALL_SIDES ); // set object color to new color.
34
35 // a choose random number between 0. and 10 for use as a scale factor.
36 float new_scale = llFrand( 10.0 );
37 llSetScale(< new_scale, new_scale, new_scale > ); // set object scale.
38
39 if ( second > 19 ) // then time to wrap this up.
40 {
41 // turn object black, print "resting" message, and reset object....
42 llSetColor( < 0, 0, 0 >, ALL_SIDES );
43
44 llSay( 0, "Object now resting and resetting script." );
45 llResetScript(); // return object to ready state.
46 }
47 }
48}
49