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
Privacy Privacy_curtains_and_doors  

Privacy_curtains_and_doors

The controller script

Category: Privacy
By : Avatar42 Farspire
Created: 2010-07-01 Edited: 2010-07-01
Worlds: Second Life

the Zip file

Download all files for Privacy_curtains_and_doors
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Privacy_curtains_and_doors_1.lsl
Get file # 2. Privacy_curtains_and_doors_2.lsl
Get file # 3. Privacy_curtains_and_doors_3.lsl
1
2 integer channel2 = 1234;
3 integer privacy = 0;
4
5 default
6 {
8 {
9 llSetText("Touch me to toggle privacy drapes", <1.0, 1.0, 1.0>, 1.0);
10 llSay(0, "Home controller online.");
11 }
12
13 touch_start(integer total_number)
14 {
15 if(privacy == 0) {
16 llShout(channel2, "privacy:on");
17 llOwnerSay("privacy:on.");
18 privacy = 1;
19 } else {
20 llShout(channel2, "privacy:off");
21 llOwnerSay("privacy:off.");
22 privacy = 0;
23 }
24 }
25 }

Privacy_curtains_and_doors

The door script

Category: Privacy
By : Avatar42 Farspire
Created: 2010-07-01 Edited: 2010-07-01
Worlds: Second Life

1
2 integer debug = 0; //1=on 0=off
3 integer channel2 = 1234;
4 integer private = 1;
5 // all debug messages should be sent through here
6 dprint(string msg)
7 {
8 if(debug)
9 {
10 llOwnerSay(llGetScriptName( ) + ":" + msg);
11 }
12 }
13
14 setPrivate(integer newP)
15 {
16 if(newP != private)
17 {
18 if( private == 0 )
19 {
20 dprint("privacy:on");
21 llSetPos( llGetPos()+ <0,1.9,0>);
22 llSetTexture("privateDoor", ALL_SIDES);
23 llSetStatus( STATUS_PHANTOM, FALSE );
24 private = 1;
25 }
26 else
27 {
28 dprint("privacy:off");
29 llSetTexture("clear", ALL_SIDES);
30 llSetStatus( STATUS_PHANTOM, TRUE );
31 llSetPos( llGetPos()+ <0,-1.9,0>);
32 private = 0;
33 }
34 }
35 }
36 default
37 {
39 {
40 llSay(0, "door online");
41 llListen(0, "", llGetOwner(), "");
42 llListen(channel2, "", "", "");
43 setPrivate(1);
44
45 }
46
47 touch_start(integer total_number)
48 {
49 llSay(0, "Door is currently locked.");
50 }
51
52 listen( integer channel, string name, key id, string message )
53 {
54 dprint("heard on:"+(string)channel+" by "+name+" key:"+(string)id + " msg:"+message);
55 if( channel == 0 && id != llGetOwner() )
56 {
57 return;
58 }
59
60 dprint("got perm");
61 if( message == "privacy:on" )
62 {
63 setPrivate(1);
64 }
65 else
66 if( message == "privacy:off" )
67 {
68 setPrivate(0);
69 }
70 }
71
72 }

Privacy_curtains_and_doors

The window script

Category: Privacy
By : Avatar42 Farspire
Created: 2010-07-01 Edited: 2010-07-01
Worlds: Second Life

1
2 integer debug = 0; //1=on 0=off
3 integer channel2 = 1234;
4 // all debug messages should be sent through here
5 dprint(string msg)
6 {
7 if(debug)
8 {
9 llOwnerSay(llGetScriptName( ) + ":" + msg);
10 }
11 }
12
13 default
14 {
16 {
17 llSay(0, "drape online");
18 llListen(0, "", llGetOwner(), "");
19 llListen(channel2, "", "", "");
20 }
21
22 touch_start(integer total_number)
23 {
24 llSay(0, "Touched.");
25 }
26
27 listen( integer channel, string name, key id, string message )
28 {
29 dprint("heard on:"+(string)channel+" by "+name+" key:"+(string)id + " msg:"+message);
30 if( channel == 0 && id != llGetOwner() )
31 {
32 return;
33 }
34
35 dprint("got perm");
36 if( message == "privacy:on" )
37 {
38 dprint("privacy:on");
39 llSetTexture("drape", ALL_SIDES);
40 }
41 else
42 if( message == "privacy:off" )
43 {
44 dprint("privacy:off");
45 llSetTexture("clear", ALL_SIDES);
46 }
47 }
48
49 }

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