Teleport Script
As modified by: Keyless Shackle.
//This is a sit teleporter by Keyless Shackle. //To use, say /1 x y z where x, y, and z are the respective coordinates. //Anyone may modify this script as long as this info remains at the top. vector d; default { on_rez(integer param) {llResetScript();} state_entry() { llListen( 1, "", llGetOwner(), ""); } listen( integer channel, string name, key id, string message ) { list parsed = llParseString2List( message, [ " " ], []); string x_string = llList2String( parsed, 0 ); float x = ( float )x_string; string y_string = llList2String( parsed, 1 ); float y = ( float )y_string; string z_string = llList2String( parsed, 2 ); float z = ( float )z_string; if(TRUE) { d = ; } if ( d.z > 768 ) //Otherwise we'll get stuck hitting the ceiling d.z = 768; integer s = (integer)(llVecMag(d-llGetPos())/10)+1; //The number of jumps necessary if ( s > 100 ) //Try and avoid stack/heap collisions with far away destinations s = 100; // 1km should be plenty integer e = (integer)( llLog( s ) / llLog( 2 ) ); //Solve '2^n=s' list rules = [ PRIM_POSITION, d ]; //The start for the rules list integer i; for ( i = 0 ; i < e ; ++i ) //Start expanding the list rules += rules; integer r = s - (integer)llPow( 2, e ); if ( r > 0 ) //Finish it up rules += llList2List( rules, 0, r * 2 + 1 ); llSetPrimitiveParams( rules ); } }