Push All Scripts

This commit is contained in:
Fred Beckhusen
2015-08-07 10:38:47 -05:00
parent 2ad9795428
commit ce47ec2f3e
8079 changed files with 2442776 additions and 0 deletions

View File

@@ -0,0 +1,147 @@
// :CATEGORY:HTTP
// :NAME:Permanent_HTTPIN_URL_persister
// :AUTHOR:donjr Spiegelblatt
// :CREATED:2012-06-16 03:41:32.957
// :EDITED:2013-09-18 15:38:59
// :ID:621
// :NUM:845
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// When you need to pass data into SL from outside, the first problem you will encounter is that llRequestURL() generates a new URL every time the script is reset, de-rezzed or the region the primitive is restarted. It becomes very difficult to keep track of the URLs and it would be easier if there were some permanent pointer that could be updated every time the primitive's URL changes.
// The script below will allow you to create a permanent primitive URL by using the services at tiny.cc. Every time the script is reset, the primitive de-rezzed or the region restarts, the script below will send a request to tiny.cc and update the short URL to point to the newly acquired URL.
//
// Setup
Go to http://tiny.cc and create an account.
Log-in at http://tiny.cc and visit http://tiny.cc/api-docs to get your API key.
// Create a primitive and a new script in that primitive.
// Copy the code from the code section below and paste it into the new script in that primitive.
// Configure the script to set-up your custom url, user name and API key.
// Configuration
// There are several options you can configure in the CONFIGURATION section:
// string CUSTOM_URL = "ksim";
// string USER_NAME = "kve";
// string API_KEY = "fbf9ra57-5d54-9fbg-89fd-711bc7b163c3";
Where USER_NAME is the name you used to sign-up on http://tiny.cc, API_KEY is the API key generated by visiting http://tiny.cc/api-docs and CUSTOM_URL is the short descriptive name of the simulator URL.
For example, the configuration above will create and update the primitive's URL, setting it to: http://tiny.cc/evesim
// Code
//
// Note there is a limit of 500 calls a day, but it really only serves as a NAME-SERVER
// :CODE:
//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3 //
// Please see: http://www.gnu.org/licenses/gpl.html //
// for legal details, rights of fair usage and //
// the disclaimer and warranty conditions. //
//////////////////////////////////////////////////////////
// With modification by: Donjr Spiegelblatt
//////////////////////////////////////////////////////////
// CONFIGURATION //
//////////////////////////////////////////////////////////
// This is the url extension, ie http://tiny.cc/biose.
string CUSTOM_URL = "hotrod";
// Set this to the username you signed up with on
// http://tiny.cc.
string USER_NAME = "hotrod";
// Set this to the API key generatred by tiny.cc. To
// generate one, visit: http://tiny.cc/api-docs and you
// will see Your "API Key:" followed by a key.
string API_KEY = "0000000-0000-0000-0000-000000000";
//////////////////////////////////////////////////////////
// INTERNALS //
//////////////////////////////////////////////////////////
key rlReq = NULL_KEY;
key glReq = NULL_KEY;
string smURL = "";
key TinyRequest(integer type)
{
string url = "http://tiny.cc/"
+ "?c=rest_api"
+ "&format=json"
+ "&version=2.0.3";
if(type) // this was the minor difference between the two two calls
url += "&m=shorten";
else
{
url += "&m=edit"
+ "&hash=" + CUSTOM_URL;
}
url += "&login=" + USER_NAME
+ "&apiKey=" + API_KEY
+ "&shortUrl=" + CUSTOM_URL
+ "&longUrl=" + llEscapeURL(smURL + "/get_url");
return llHTTPRequest( url, [HTTP_METHOD, "GET"], "");
}
default
{
state_entry()
{
llRequestURL();
}
on_rez(integer param)
{
llResetScript();
}

View File

@@ -0,0 +1,74 @@
// :CATEGORY:HTTP
// :NAME:Permanent_HTTPIN_URL_persister
// :AUTHOR:donjr Spiegelblatt
// :CREATED:2012-06-16 03:41:32.957
// :EDITED:2013-09-18 15:38:59
// :ID:621
// :NUM:846
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// This is a simple example of using an LSL-script to query the other script and get results.
// :CODE:
key rlReq;
key fReq = NULL_KEY;
string newpath = "";
key Request(string cmd)
{
llSay(0, "sending="+newpath+"?"+cmd);
return llHTTPRequest( newpath+"?"+cmd, [HTTP_METHOD, "GET"], "");
}
default
{
state_entry()
{
}
on_rez(integer param)
{
llResetScript();
}
touch_start(integer xx)
{
rlReq = llHTTPRequest( "http://tiny.cc/hotrod", [HTTP_METHOD, "GET"], ""); // find the other object/script
// llSay(0, "MyKey="+(string)llGetKey());
}
http_response(key request_id, integer status, list metadata, string body)
{
if (rlReq == request_id)
{
rlReq = NULL_KEY; // the same event sometimes shows up more then once

View File

@@ -0,0 +1,7 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|08 Sep 2013 03:49:04 -0000
vti_extenderversion:SR|12.0.0.6211
vti_backlinkinfo:VX|
vti_author:SR|alien\\fred
vti_modifiedby:SR|alien\\fred
vti_timecreated:TR|18 Sep 2013 20:38:59 -0000

View File

@@ -0,0 +1,7 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|08 Sep 2013 03:49:04 -0000
vti_extenderversion:SR|12.0.0.6211
vti_backlinkinfo:VX|
vti_author:SR|alien\\fred
vti_modifiedby:SR|alien\\fred
vti_timecreated:TR|18 Sep 2013 20:38:59 -0000

View File

@@ -0,0 +1,8 @@
<Project name="Permanent_HTTPIN_URL_persister" guid="D8CA8E9F-6C00-1014-B904-200204C60A89">
<Object name="Object" guid="D8CA8FA6-6C00-1014-B904-200204C60A89">
<Script name="Permanent_HTTPIN_URL_persister_1.lsl" guid="D8CAC20F-6C00-1014-B904-200204C60A89">
</Script>
<Script name="Permanent_HTTPIN_URL_persister_2.lsl" guid="D8CAE833-6C00-1014-B904-200204C60A89">
</Script>
</Object>
</Project>

View File

@@ -0,0 +1,6 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|17 Aug 2013 23:32:40 -0000
vti_extenderversion:SR|12.0.0.0
vti_cacheddtm:TX|17 Aug 2013 23:32:40 -0000
vti_filesize:IR|412
vti_backlinkinfo:VX|