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
Sound Sound_Prim_Script__Intermittent  

Sound_Prim_Script__Intermittent

Sound Prim Script - Intermittent.lsl

Category: Sound
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Sound_Prim_Script__Intermittent
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Sound_Prim_Script__Intermittent_1.lsl
1
2
3 // Sound Prim Script - Intermittent
4 //
5 // Randomly picks a sound in inventory, plays it,
6 // waits a random interval, repeats.
7 //
8 // Set this between 0.0 and 1.0
9 float LOUDNESS = 0.5;
10 //
11 // Interval in seconds to be silent.
12 // If you set these to be less than 10 seconds,
13 // they default to 10 seconds.
14 integer SHORTEST = 60;
15 integer LONGEST = 180;
16 //
17 ////////////////////////////////////////////////
18 default
19 {
20
22 {
23 if(SHORTEST < 10 ) SHORTEST = 10;
24 if(LONGEST < 10 ) LONGEST = 10;
25 if(SHORTEST > LONGEST) SHORTEST = LONGEST;
26
27 llSleep( 1.0 );
28 state noisy;
29 }
30
31 on_rez(integer start_param)
32 {
33 llSleep( 1.0 );
34 state noisy;
35 }
36
37 }
38 ////////////////////////////////////////////////
39 state noisy
40 {
41
43 {
45
46 if( sounds <= 0 ) state default;
47
49 if( soundname != "" )
50 {
51 llPlaySound( soundname, LOUDNESS );
52 }
53
54 state silent;
55 }
56
57 on_rez(integer start_param)
58 {
59 state default;
60 }
61
62 }
63 ////////////////////////////////////////////////
64 state silent
65 {
66
68 {
69 llSleep( (float)(llFloor(llFrand(LONGEST - SHORTEST)) + SHORTEST) );
70 state noisy;
71 }
72
73 on_rez(integer start_param)
74 {
75 state default;
76 }
77
78 }
79
80 // END //

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