aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-07-01 11:59:23 +1000
committeronefang2019-07-01 11:59:23 +1000
commit9a9177ca07cce2721a6db88738c74a29c10362de (patch)
tree0760e1ffb8f647ef122c1a03396f39f85e575e70
parentInclude the actual source code this time. (diff)
download1ring-9a9177ca07cce2721a6db88738c74a29c10362de.zip
1ring-9a9177ca07cce2721a6db88738c74a29c10362de.tar.gz
1ring-9a9177ca07cce2721a6db88738c74a29c10362de.tar.bz2
1ring-9a9177ca07cce2721a6db88738c74a29c10362de.tar.xz
Oops, wrong version of the leash holder script.
-rw-r--r--onefang's leash holder and 1ring support.lsl94
-rw-r--r--onefang's leash holder.lsl44
2 files changed, 94 insertions, 44 deletions
diff --git a/onefang's leash holder and 1ring support.lsl b/onefang's leash holder and 1ring support.lsl
new file mode 100644
index 0000000..e9a11e0
--- /dev/null
+++ b/onefang's leash holder and 1ring support.lsl
@@ -0,0 +1,94 @@
1
2integer mychannel = -8888;
3integer particle_chan = -270510;
4string listenfor;
5string response;
6string detach;
7
8key masterid;
9key handle;
10key them = NULL_KEY;
11string URL = "";
12key RequestID;
13
14default
15{
16 state_entry()
17 {
18 masterid = llGetOwner();
19 handle = llGetKey();
20 listenfor = (string)masterid + "handle";
21 response = (string)masterid + "handle ok";
22 detach = (string)masterid + "handle detached";
23 llListen(mychannel, "", NULL_KEY, listenfor);
24 llSay(mychannel, response);
25 }
26
27 attach(key id)
28 {
29 if (NULL_KEY == id)
30 llSay(mychannel, detach);
31 }
32
33 listen(integer channel, string name, key id, string message)
34 {
35 llSay(mychannel, response);
36 llSay(particle_chan, handle + "#" + masterid);
37 if (NULL_KEY == them)
38 them = llGetOwnerKey(id);
39 }
40
41 dataserver(key id, string data)
42 {
43 list input = llParseStringKeepNulls(data, ["|"], []);
44 string domain = llList2String(input, 0);
45 if ("URL" == domain)
46 URL = llList2String(input, 1);
47 }
48
49 http_response(key id, integer status, list metaData, string body)
50 {
51 if (id == RequestID)
52 {
53 RequestID = NULL_KEY;
54 if (status != 200)
55 llOwnerSay("HTTP error code " + status + "\n" + body);
56 }
57 else if (id == NULL_KEY)
58 llOwnerSay("Too many HTTP requests too fast!");
59 }
60
61 on_rez(integer param)
62 {
63 llResetScript();
64 }
65
66 touch_start(integer total_number)
67 {
68 llSay(particle_chan, handle + "#" + masterid);
69 }
70
71 changed(integer change)
72 {
73 if ("" != URL)
74 {
75 if (change & CHANGED_REGION)
76 {
77 RequestID = llHTTPRequest(URL,
78 [HTTP_METHOD, "POST", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384],
79 llEscapeURL("REGION|" + llGetRegionName() + "|" + (string)llGetPos()));
80 llOwnerSay("Changed region to " + llGetRegionName() + " - " + (string)llGetPos()
81 + "\n Requesting that " + osKey2Name(them) + " join me.");
82 }
83 else if (change & CHANGED_TELEPORT)
84 {
85 llSleep(1.0);
86 RequestID = llHTTPRequest(URL,
87 [HTTP_METHOD, "POST", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384],
88 llEscapeURL("TELEPORT|" + llGetRegionName() + "|" + (string)llGetPos()));
89 llOwnerSay("Teleported to " + llGetRegionName() + " - " + (string)llGetPos()
90 + "\n Requesting that " + osKey2Name(them) + " join me.");
91 }
92 }
93 }
94}
diff --git a/onefang's leash holder.lsl b/onefang's leash holder.lsl
deleted file mode 100644
index 6d7b360..0000000
--- a/onefang's leash holder.lsl
+++ /dev/null
@@ -1,44 +0,0 @@
1integer mychannel = -8888;
2integer particle_chan = -270510;
3string listenfor;
4string response;
5string detach;
6
7key masterid;
8key handle;
9
10default
11{
12 state_entry()
13 {
14 masterid = llGetOwner();
15 handle = llGetKey();
16 listenfor = (string)masterid + "handle";
17 response = (string)masterid + "handle ok";
18 detach = (string)masterid + "handle detached";
19 llListen(mychannel, "", NULL_KEY, listenfor);
20 llSay(mychannel, response);
21 }
22
23 attach(key id)
24 {
25 if (NULL_KEY == id)
26 llSay(mychannel, detach);
27 }
28
29 listen(integer channel, string name, key id, string message)
30 {
31 llSay(mychannel, response);
32 llSay(particle_chan, handle + "#" + masterid);
33 }
34
35 on_rez(integer param)
36 {
37 llResetScript();
38 }
39
40 touch_start(integer total_number)
41 {
42 llSay(particle_chan, handle + "#" + masterid);
43 }
44}