Due to Clockwerk entering a suspend state, the teleport script below performs a knock-event by contacting the destination grid over HTTP, waking Clockwerk up, after which it proceeds to teleport the agent. It is advisable to use this script or similar scripts that first knock on the sleep ports of Clockwerk (80
and 9000
such that you do not experience failures while the grid is suspended.
/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // SETTINGS // /////////////////////////////////////////////////////////////////////////// // the x and y map coordinates for the destination region integer map_x = 8502; integer map_y = 8504; // the SLURL of the destination region string SLURL = "http://repo.bio-se.info:9000"; // the landing point in local coordinates vector landingPoint = <182, 225, 26>; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// key agent = NULL_KEY; default { state_entry() { llSetText("Click To Teleport", <0,1,0>, 1.0); } touch_start(integer num_detected) { agent = llDetectedKey(0); state knock; } } state knock { state_entry() { llSetText("Teleporting you, please wait...", <1,1,0>, 1.0); llHTTPRequest(SLURL, [HTTP_METHOD, "GET"], ""); } http_response(key reqID, integer status, list metadata, string body) { if(status != 200) { llSetText("Destination could not be contacted...", <1,0,0>, 1.0); llSetTimerEvent(5); return; } llSetText("Teleporting...", <0,1,0>, 1.0); state teleport; } timer() { state default; } changed(integer change) { if(change & CHANGED_REGION_START) llResetScript(); } } state teleport { state_entry() { osTeleportAgent(agent, map_x, map_y, landingPoint, <1,1,1>); state default; } changed(integer change) { if(change & CHANGED_REGION_START) llResetScript(); } }