Adds discord relay plugin
This commit is contained in:
parent
6ad891e5ac
commit
5674233bf8
5 changed files with 65 additions and 46 deletions
|
@ -3,6 +3,10 @@
|
|||
string API_SERVER;
|
||||
integer g_iActive = 1;
|
||||
integer g_iRegistered=0;
|
||||
integer g_iError=0;
|
||||
string g_kPayload;
|
||||
string g_sItem;
|
||||
|
||||
|
||||
default {
|
||||
state_entry() {
|
||||
|
@ -74,16 +78,31 @@ default {
|
|||
// Deliver if we have the item
|
||||
if(llGetInventoryType(sRequest) != INVENTORY_NONE) {
|
||||
llGiveInventory(sID, sRequest);
|
||||
llWhisper(999, sPayload);
|
||||
g_iError=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Log this as an error in delivery
|
||||
llWhisper(998, sPayload);
|
||||
g_iError=1;
|
||||
}
|
||||
|
||||
g_sItem = sRequest;
|
||||
|
||||
g_kPayload = llRequestUsername(sID);
|
||||
|
||||
llSleep(0.25);
|
||||
llMessageLinked(LINK_SET, 0, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
dataserver(key kID, string sData) {
|
||||
if(kID == g_kPayload) {
|
||||
llSay(0x9CB9, llList2Json(JSON_OBJECT, [
|
||||
"user", sData,
|
||||
"msg", "Delivery of item '" + g_sItem + "'",
|
||||
"author", "Relay",
|
||||
"title", "Farm Delivery Server"
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue