Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Dance Dancefloor  

Dancefloor

Dancefloor.lsl

Category: Dance
By : Siggy Romulus
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Dancefloor
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Dancefloor_1.lsl
1
2 //======================================================================
3 // Low Lag 10 x 10 Disco Floor - Siggy Romulus - Get_Toe() Script
4 //----------------------------------------------------------------------
5 // Use a single script to control 15 randomly changing danceflor
6 // squares
7 //======================================================================
8 // Variables
9 //----------------------------------------------------------------------
10
11 integer LISTEN_HANDLER;
12
13 // Overall set of colors and a list to randomise
14
15 integer CURRENT; // current place in the color list
16
17 list COLORSET = [ <1.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 1.0>,
18 <1.0, 1.0, 0.0>, <1.0, 0.0, 1.0>, <1.0, 1.0 ,1.0>,
19 <1.0, 0.5, 0.0>, <0.5, 1.0, 0.0>, <0.0, 0.5, 1.0>,
20 <0.5, 0.0, 1.0>, <1.0, 0.0, 0.0>, <0.0, 1.0, 0.0>,
21 <0.0, 0.0, 1.0>, <1.0, 1.0, 0.0>, <1.0, 0.0, 1.0>,
22 <0.0, 1.0 ,1.0>, <1.0, 0.5, 0.0>, <0.5, 1.0, 0.0>,
23 <0.0, 0.5, 1.0>, <0.5, 0.0, 1.0>, <1.0, 0.0, 0.0>,
24 <0.0, 1.0, 0.0>, <0.0, 0.0, 1.0>, <1.0, 1.0, 0.0>,
25 <1.0, 0.0, 1.0>, <0.0, 1.0 ,1.0>, <1.0, 0.5, 0.0>,
26 <1.0, 1.0, 0.0>, <0.0, 0.5, 1.0>, <0.5, 0.0, 1.0>];
27 list COLORUSE;
28 //======================================================================
29 // Functions
30 //----------------------------------------------------------------------
31 Init()
32 {
33 integer x;
34
35 for (x = 2; x < 27; x++)
36 {
37 llSetLinkColor(x, <1,1,1>, ALL_SIDES); // Set All Squares White
38 }
39 COLORUSE = llListRandomize(COLORSET, 1); // Scramble the colors
40 for (x = 2; x < 27; x++)
41 {
42 llSetLinkColor(x, llList2Vector(COLORUSE, x), ALL_SIDES);
43 }
44 COLORUSE = llListRandomize(COLORSET, 1); // Rescramble them
45 }
46 //----------------------------------------------------------------------
47 Update_Squares()
48 {
49 integer x;
50 integer y;
51
52 for (x = 0; x < 20; x++) // Update 10 squares
53 {
54 y = (integer) llFrand(25.0);
55 y +=2;
56
57 llSetLinkColor(y, llList2Vector(COLORUSE, CURRENT), ALL_SIDES);
58
59 CURRENT++;
60
61 if(CURRENT > 20)
62 CURRENT = 0;
63
64 }
65 }
66 //======================================================================
67 // States
68 //----------------------------------------------------------------------
69
70 default
71 {
73 {
75 Init();
76 LISTEN_HANDLER = llListen(0, "", llGetOwner(), "");
77
78 }
79
80 listen(integer channel, string name, key id, string msg)
81 {
82 if(msg == "START!")
83 {
84 llSetLinkColor(1, <0,0,0.2>, ALL_SIDES);
85 llSetTimerEvent(1.50); // Every second
86 }
87 else if(msg == "STOP!")
88 {
89 llSetLinkColor(1, <0,0,0>, ALL_SIDES);
90 llSetTimerEvent(0.00); // Reset timer
91 }
92 else if(msg == "RESET!")
93 {
94 llSetLinkColor(1, <0,0,0.2>, ALL_SIDES);
95 Init();
96 llSetTimerEvent(1.50);
97 }
98 }
99
100 timer()
101 {
102 Update_Squares();
103 }
104
105
106 on_rez(integer start_param)
107 {
108 Init();
109 }
110 }
111 // END //

Back to the Best Free Tools in Second Life and OpenSim.