corrade-lsl-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ HEAD  →  ?path2? @ 1
File deleted
/source/select-dialog-options/menu-harness/menu-harness.lsl
File deleted
/source/select-dialog-options/menu-harness/configuration.txt
File deleted
/source/select-dialog-options/select-dialog-options/select-dialog-options.lsl
File deleted
/source/select-dialog-options/select-dialog-options/configuration.txt
File deleted
/source/remote-region-scanning-device/remote-region-scanning-device.lsl
File deleted
/source/remote-region-scanning-device/regions.txt
File deleted
/source/remote-region-scanning-device/configuration.txt
File deleted
/source/rental-system/configuration.txt
File deleted
/source/rental-system/rental-system.lsl
File deleted
/source/accept-animation-from-agent/accept-animation-from-agent.lsl
File deleted
/source/accept-animation-from-agent/configuration.txt
File deleted
/source/region-restart-evader/region-restart-evader.lsl
File deleted
\ No newline at end of file
/source/region-restart-evader/configuration.txt
File deleted
/source/heads-up-display/fly/fly.lsl
File deleted
/source/heads-up-display/point-at/point-at.lsl
File deleted
/source/heads-up-display/go-home/go-home.lsl
File deleted
/source/heads-up-display/permission-passthrough/permission-passthrough.lsl
File deleted
/source/heads-up-display/message-relay/message-relay.lsl
File deleted
\ No newline at end of file
/source/heads-up-display/teleport/teleport.lsl
File deleted
/source/heads-up-display/sit/sit.lsl
File deleted
\ No newline at end of file
/source/heads-up-display/joystick/joystick.lsl
File deleted
/source/heads-up-display/tell/tell.lsl
File deleted
/source/heads-up-display/patrol/patrol.lsl
File deleted
/source/heads-up-display/heads-up-display.lsl
File deleted
\ No newline at end of file
/source/heads-up-display/recall/recall.lsl
File deleted
/source/heads-up-display/dialog-passthrough/dialog-passthrough.lsl
File deleted
\ No newline at end of file
/source/heads-up-display/stand/stand.lsl
File deleted
\ No newline at end of file
/source/heads-up-display/relax/relax.lsl
File deleted
/source/heads-up-display/touch/touch.lsl
File deleted
/source/heads-up-display/grid-follow/grid-follow.lsl
File deleted
/source/heads-up-display/configuration.txt
File deleted
/source/sit-and-animate/sit-and-animate.lsl
File deleted
/source/sit-and-animate/set-sit-target.lsl
File deleted
/source/sit-and-animate/configuration.txt
File deleted
/source/sit-and-animate/corrade-interface.lsl
File deleted
/source/texture-changing/configuration.txt
File deleted
/source/texture-changing/texture-changing.lsl
File deleted
/source/group-fortune/fortunes.txt
File deleted
/source/group-fortune/group-fortune.lsl
File deleted
/source/group-fortune/configuration.txt
File deleted
/source/visitor-track-and-record/XyzzyText.lsl
File deleted
/source/visitor-track-and-record/configuration.txt
File deleted
/source/visitor-track-and-record/visitor-track-and-record.lsl
File deleted
/source/polygon-patrol-movement/configuration.txt
File deleted
/source/polygon-patrol-movement/polygon-patrol-movement.lsl
File deleted
/source/automated-hunt-system/configuration.txt
File deleted
/source/automated-hunt-system/automated-hunt-system.lsl
File deleted
/source/instant-message-chatbot/instant-message-chatbot.lsl
File deleted
/source/instant-message-chatbot/configuration.txt
File deleted
/source/grid-follow/configuration.txt
File deleted
/source/grid-follow/grid-follow.lsl
File deleted
/source/avatar-shape-gender-detector/configuration.txt
File deleted
/source/avatar-shape-gender-detector/avatar-shape-gender-detector.lsl
File deleted
/source/punish-bad-words/configuration.txt
File deleted
/source/punish-bad-words/punish-bad-words.lsl
File deleted
/source/punish-bad-words/badwords.txt
File deleted
/source/greet-invite-track-group-members/configuration.txt
File deleted
/source/greet-invite-track-group-members/greet-invite-track-group-members.lsl
File deleted
/source/whitelist-accept-inventory-offers/whitelist-accept-inventory-offers.lsl
File deleted
/source/whitelist-accept-inventory-offers/configuration.txt
File deleted
/source/multiple-group-notices/configuration.txt
File deleted
/source/multiple-group-notices/multiple-group-notices.lsl
File deleted
/source/eggdrop/Jokes_9.txt
File deleted
/source/eggdrop/help.lsl
File deleted
/source/eggdrop/joke-database.lsl
File deleted
/source/eggdrop/softban.lsl
File deleted
/source/eggdrop/survey.lsl
File deleted
/source/eggdrop/urbandictionary.lsl
File deleted
/source/eggdrop/invite.lsl
File deleted
/source/eggdrop/heartbeat.lsl
File deleted
/source/eggdrop/jenkins.lsl
File deleted
/source/eggdrop/Jokes_20.txt
File deleted
/source/eggdrop/Jokes_21.txt
File deleted
/source/eggdrop/wiki.lsl
File deleted
/source/eggdrop/Jokes_22.txt
File deleted
/source/eggdrop/unban.lsl
File deleted
/source/eggdrop/Jokes_23.txt
File deleted
/source/eggdrop/dice.lsl
File deleted
/source/eggdrop/IM.lsl
File deleted
/source/eggdrop/Jokes_24.txt
File deleted
/source/eggdrop/Jokes_25.txt
File deleted
/source/eggdrop/Fortune.txt
File deleted
/source/eggdrop/Jokes_26.txt
File deleted
/source/eggdrop/Jokes_27.txt
File deleted
/source/eggdrop/Help.txt
File deleted
/source/eggdrop/control.lsl
File deleted
/source/eggdrop/joke-notecard.lsl
File deleted
/source/eggdrop/reminders.lsl
File deleted
/source/eggdrop/configuration.txt
File deleted
/source/eggdrop/softunban.lsl
File deleted
/source/eggdrop/corrade-eggdrop-joke.sql
File deleted
\ No newline at end of file
/source/eggdrop/Jokes_10.txt
File deleted
/source/eggdrop/ban.lsl
File deleted
/source/eggdrop/Jokes_11.txt
File deleted
/source/eggdrop/Jokes_12.txt
File deleted
/source/eggdrop/motd.lsl
File deleted
/source/eggdrop/Jokes_13.txt
File deleted
/source/eggdrop/Jokes_14.txt
File deleted
/source/eggdrop/Jokes_15.txt
File deleted
/source/eggdrop/Jokes_16.txt
File deleted
/source/eggdrop/Jokes_17.txt
File deleted
/source/eggdrop/Jokes_18.txt
File deleted
/source/eggdrop/Jokes_19.txt
File deleted
/source/eggdrop/spank.lsl
File deleted
/source/eggdrop/Jokes_1.txt
File deleted
/source/eggdrop/notice.lsl
File deleted
/source/eggdrop/Jokes_2.txt
File deleted
/source/eggdrop/fortune.lsl
File deleted
/source/eggdrop/Jokes_3.txt
File deleted
/source/eggdrop/Jokes_4.txt
File deleted
/source/eggdrop/Jokes_5.txt
File deleted
/source/eggdrop/Jokes_6.txt
File deleted
/source/eggdrop/version.lsl
File deleted
/source/eggdrop/Jokes_7.txt
File deleted
/source/eggdrop/Jokes_8.txt
File deleted
/source/eggdrop/eval.lsl
File deleted
/source/local-chat-to-instant-message/local-chat-to-instant-message.lsl
File deleted
/source/local-chat-to-instant-message/configuration.txt
File deleted

Property changes:

Deleted: svn:executable
-*
\ No newline at end of property

/source/fetch/fetch.lsl
File deleted

Property changes:

Deleted: svn:executable
-*
\ No newline at end of property

/source/fetch/configuration.txt
File deleted
/source/local-chat-chatbot/configuration.txt
File deleted
/source/local-chat-chatbot/local-chat-chatbot.lsl
File deleted
\ No newline at end of file
/source/grid-avatar-tracker/configuration.txt
File deleted
/source/grid-avatar-tracker/map.lsl
File deleted
/source/grid-avatar-tracker/dot.lsl
File deleted
/source/look-at-typing-avatar/look-at-typing-avatar.lsl
File deleted
/source/look-at-typing-avatar/configuration.txt
File deleted
/source/circular-patrol-movement/circular-patrol-movement.lsl
File deleted
/source/circular-patrol-movement/configuration.txt
File deleted
/source/scheduled-group-notices/crontab.lsl
File deleted
/source/scheduled-group-notices/scheduled-group-notices.lsl
File deleted
/source/scheduled-group-notices/schedules.txt
File deleted
/source/batch-change-region-covenant/batch-change-region-covenant.lsl
File deleted
\ No newline at end of file
/source/batch-change-region-covenant/covenant.txt
File deleted
/source/batch-change-region-covenant/regions.txt
File deleted
/source/batch-change-region-covenant/configuration.txt
File deleted
/source/puppeteer-pathfinding/puppeteer-pathfinding.lsl
File deleted
/source/puppeteer-pathfinding/configuration.txt
/heads-up-display/dialog-passthrough/dialog-passthrough.lsl
@@ -0,0 +1,502 @@
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
//
// This script is a passthrough or proxy script for dialogs received by
// Corrade. The script binds to Corrade's dialog notification and then any
// dialog received by Corrade gets sent to you. When you press a button on
// the dialog, Corrade will press the button on the dialog it received.
//
// For more information on Corrade, please see:
// http://grimore.org/secondlife/scripted_agents/corrade
//
///////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
string wasKeyValueGet(string k, string data) {
if(llStringLength(data) == 0) return "";
if(llStringLength(k) == 0) return "";
list a = llParseString2List(data, ["&", "="], []);
integer i = llListFindList(llList2ListStrided(a, 0, -1, 2), [ k ]);
if(i != -1) return llList2String(a, 2*i+1);
return "";
}
///////////////////////////////////////////////////////////////////////////
// Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
string wasKeyValueEncode(list data) {
list k = llList2ListStrided(data, 0, -1, 2);
list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2);
data = [];
do {
data += llList2String(k, 0) + "=" + llList2String(v, 0);
k = llDeleteSubList(k, 0, 0);
v = llDeleteSubList(v, 0, 0);
} while(llGetListLength(k) != 0);
return llDumpList2String(data, "&");
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
// escapes a string in conformance with RFC1738
string wasURLEscape(string i) {
string o = "";
do {
string c = llGetSubString(i, 0, 0);
i = llDeleteSubString(i, 0, 0);
if(c == "") jump continue;
if(c == " ") {
o += "+";
jump continue;
}
if(c == "\n") {
o += "%0D" + llEscapeURL(c);
jump continue;
}
o += llEscapeURL(c);
@continue;
} while(i != "");
return o;
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
list wasCSVToList(string csv) {
list l = [];
list s = [];
string m = "";
do {
string a = llGetSubString(csv, 0, 0);
csv = llDeleteSubString(csv, 0, 0);
if(a == ",") {
if(llList2String(s, -1) != "\"") {
l += m;
m = "";
jump continue;
}
m += a;
jump continue;
}
if(a == "\"" && llGetSubString(csv, 0, 0) == a) {
m += a;
csv = llDeleteSubString(csv, 0, 0);
jump continue;
}
if(a == "\"") {
if(llList2String(s, -1) != a) {
s += a;
jump continue;
}
s = llDeleteSubList(s, -1, -1);
jump continue;
}
m += a;
@continue;
} while(csv != "");
// postcondition: length(s) = 0
return l + m;
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
// unescapes a string in conformance with RFC1738
string wasURLUnescape(string i) {
return llUnescapeURL(
llDumpList2String(
llParseString2List(
llDumpList2String(
llParseString2List(
i,
["+"],
[]
),
" "
),
["%0D%0A"],
[]
),
"\n"
)
);
}
 
// callback URL
string callback = "";
// configuration data
string configuration = "";
// listen handle
integer listenHandle = 0;
 
// store dialog details
key dialog_item = NULL_KEY;
key dialog_id = NULL_KEY;
integer dialog_channel = 0;
list dialog_buttons = [];
string dialog_message = "";
 
default {
state_entry() {
llSetTimerEvent(1);
}
link_message(integer sender, integer num, string message, key id) {
if(sender != 1 || id != "configuration") return;
configuration = message;
state off;
}
timer() {
llMessageLinked(LINK_ROOT, 0, "configuration", NULL_KEY);
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
state_exit() {
llSetTimerEvent(0);
}
}
 
state off {
state_entry() {
llReleaseControls();
llSetColor(<.5,0,0>, ALL_SIDES);
}
touch_end(integer num) {
state on;
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
}
 
state on {
state_entry() {
llSetColor(<0,.5,0>, ALL_SIDES);
state url;
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
}
 
state url {
state_entry() {
// DEBUG
llOwnerSay("Requesting URL...");
llRequestURL();
}
touch_end(integer num) {
llSetColor(<.5,0,0>, ALL_SIDES);
llResetScript();
}
http_request(key id, string method, string body) {
if(method != URL_REQUEST_GRANTED) return;
callback = body;
// DEBUG
llOwnerSay("Got URL...");
state dialog;
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
}
 
state dialog {
state_entry() {
// DEBUG
llOwnerSay("Binding to the dialog notification...");
llInstantMessage(
(key)wasKeyValueGet(
"corrade",
configuration
),
wasKeyValueEncode(
[
"command", "notify",
"group", wasURLEscape(
wasKeyValueGet(
"group",
configuration
)
),
"password", wasURLEscape(
wasKeyValueGet(
"password",
configuration
)
),
"action", "set",
"type", "dialog",
"URL", wasURLEscape(callback),
"callback", wasURLEscape(callback)
]
)
);
llSetTimerEvent(60);
}
touch_end(integer num) {
llSetColor(<.5,0,0>, ALL_SIDES);
llResetScript();
}
timer() {
// DEBUG
llOwnerSay("Timeout binding to the dialog notification...");
llResetScript();
}
http_request(key id, string method, string body) {
llHTTPResponse(id, 200, "OK");
if(wasKeyValueGet("command", body) != "notify" ||
wasKeyValueGet("success", body) != "True") {
// DEBUG
llOwnerSay("Failed to bind to the dialog notification..." + wasKeyValueGet("error", body));
llResetScript();
}
// DEBUG
llOwnerSay("Dialog notification installed...");
state main;
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
state_exit() {
llSetTimerEvent(0);
}
}
 
state main {
state_entry() {
// DEBUG
llOwnerSay("Waiting for dialog...");
llSetTimerEvent(1);
}
touch_end(integer num) {
state uninstall;
}
timer() {
llRequestAgentData(
(key)wasKeyValueGet(
"corrade",
configuration
), DATA_ONLINE);
}
dataserver(key id, string data) {
if(data != "1") llResetScript();
}
http_request(key id, string method, string body) {
llHTTPResponse(id, 200, "OK");
// get the dialog id
dialog_id = (key)wasURLUnescape(
wasKeyValueGet(
"id",
body
)
);
// get the dialog message
dialog_message = wasURLUnescape(
wasKeyValueGet(
"message",
body
)
);
// get the UUID of the object sending the dialog
dialog_item = (key)wasURLUnescape(
wasKeyValueGet(
"item",
body
)
);
// get the channel that the dialog was sent on
dialog_channel = (integer)wasURLUnescape(
wasKeyValueGet(
"channel",
body
)
);
// get the buttons that the dialog has
dialog_buttons = llList2ListStrided(
llDeleteSubList(
wasCSVToList(
wasURLUnescape(
wasKeyValueGet(
"button",
body
)
)
),
0,
1
),
0,
-1,
2
);
// DEBUG
llOwnerSay("Got buttons: " + llDumpList2String(dialog_buttons, "|"));
listenHandle = llListen(-14, "", llGetOwner(), "");
llDialog(llGetOwner(), "[CORRADE]: " + dialog_message, dialog_buttons, -14);
}
listen(integer channel, string name, key id, string message) {
llListenRemove(listenHandle);
integer index = llListFindList(dialog_buttons, (list)message);
if(index == -1) {
// DEBUG
llOwnerSay("Button index not found...");
return;
}
llInstantMessage(
wasKeyValueGet(
"corrade",
configuration
),
wasKeyValueEncode(
[
"command", "replytoscriptdialog",
"group", wasURLEscape(
wasKeyValueGet(
"group",
configuration
)
),
"password", wasURLEscape(
wasKeyValueGet(
"password",
configuration
)
),
"action", "reply",
"dialog", dialog_id,
"button", wasURLEscape(message),
"index", index
]
)
);
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
state_exit() {
llSetTimerEvent(0);
}
}
 
state uninstall {
state_entry() {
// DEBUG
llOwnerSay("Uninstalling dialog notification...");
llInstantMessage(
(key)wasKeyValueGet(
"corrade",
configuration
),
wasKeyValueEncode(
[
"command", "notify",
"group", wasURLEscape(
wasKeyValueGet(
"group",
configuration
)
),
"password", wasURLEscape(
wasKeyValueGet(
"password",
configuration
)
),
"action", "remove",
"type", "dialog",
"URL", wasURLEscape(callback),
"callback", wasURLEscape(callback)
]
)
);
llSetTimerEvent(60);
}
timer() {
// DEBUG
llOwnerSay("Timeout uninstalling the dialog notification...");
llResetScript();
}
http_request(key id, string method, string body) {
llHTTPResponse(id, 200, "OK");
if(wasKeyValueGet("command", body) != "notify" ||
wasKeyValueGet("success", body) != "True") {
// DEBUG
llOwnerSay("Failed to uninstall the dialog notification..." + wasKeyValueGet("error", body));
llResetScript();
}
// DEBUG
llOwnerSay("Dialog notification uninstalled...");
llResetScript();
}
attach(key id) {
llResetScript();
}
on_rez(integer num) {
llResetScript();
}
changed(integer change) {
if((change & CHANGED_INVENTORY) || (change & CHANGED_REGION_START) || (change & CHANGED_OWNER)) {
llResetScript();
}
}
}