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 WarpPos_Teleporter  

WarpPos_Teleporter

WarpPos_Teleporter

Category: Teleport
By : Davy Maltz
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for WarpPos_Teleporter
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. WarpPos_Teleporter_1.lsl
1 WarpPos()
2 {
3 integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 30.0) + 1;
4
5 if(jumps > 200 )
6 jumps = 200;
7 list rules = [ PRIM_POSITION, destpos ];
8 integer count = 1;
9 while( ( count = count << 1 ) < jumps)
10 rules = (rules=[]) + rules + rules;
11 llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
12 while(llGetPos() != destpos)
13 WarpPos();
14 }
15 vector destpos;
16 default
17 {
18 on_rez(integer start_param)
19 {
20 llSay(0,"Say '.pos <position>' To Set The Destination To The Specified Position, And '.warp' To Warp The Object To The Defined Position.(You Must Be Sitting On The Object If You Want To Warp Yourself With The Object.)");
22 }
24 {
25 llSetTimerEvent(0.1);
26 llListen(0,"",llGetOwner(),"");
27 }
28 timer()
29 {
30 if(destpos != ZERO_VECTOR)
31 {
32
33 llSetText("WarpPos Warper: Ready. Destination Set To " + (string)destpos + ".",<0,1,0>,1.0);
34 }
35 else
36 {
37 llSetText("WarpPos Warper: Not Ready. No Destination Set.",<1,0,0>,1.0);
38 }
39 }
40 listen(integer channel, string name, key id, string message)
41 {
42 if(llToLower(message) == ".warp")
43 {
44 if(destpos == ZERO_VECTOR)
45 {
46 llSay(0,"No Destination Defined. Say '.pos <position>' To Set The Destination To The Specified Position.");
47 }
48 else
49 {
50 WarpPos();
51 }
52 }
53 else if(llSubStringIndex(llToLower(message),".pos ") != -1)
54 {
55 if(llSubStringIndex(message,"<") == -1)
56 {
57 destpos = (vector)("<" + llGetSubString(llToLower(message),5,llStringLength(message)) + ">");
58 }
59 else if(llSubStringIndex(message,"<") != -1)
60 {
61 destpos = (vector)llGetSubString(llToLower(message),5,llStringLength(message));
62 }
63 }
64 }
65 }

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