corrade-lsl-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 14  →  ?path2? @ 15
/source/eggdrop/unban.lsl
@@ -182,6 +182,7 @@
// banee
string firstname = "";
string lastname = "";
string soft = "True";
 
default {
state_entry() {
@@ -241,11 +242,14 @@
return;
// Check if the command matches the current module.
list command = llParseString2List(data,
[wasKeyValueGet("command", configuration), " "], ["@"]);
if(llList2String(command, 0) != "unban")
list command = llParseString2List(data, [" "], []);
if(llList2String(command, 0) !=
wasKeyValueGet("command", configuration) + "unban")
return;
// Remove command.
command = llDeleteSubList(command, 0, 0);
firstname = wasKeyValueGet("firstname", message);
lastname = wasKeyValueGet("lastname", message);
@@ -254,9 +258,6 @@
state tell;
}
// Remove command.
command = llDeleteSubList(command, 0, 0);
// Dump the rest of the message.
data = llDumpList2String(command, " ");
@@ -370,7 +371,9 @@
list banee = llParseString2List(data, [" "], []);
firstname = llList2String(banee, 0);
lastname = llList2String(banee, 1);
banee = llDeleteSubList(banee, 0, 0);
lastname = llList2String(banee, 0);
banee = llDeleteSubList(banee, 0, 0);
if(firstname == "" || lastname == "") {
data = "Full name required.";
@@ -377,6 +380,12 @@
state tell;
}
if(llGetListLength(banee) != 0 &&
llToLower(llList2String(banee, 0)) == "nosoft") {
soft = "False";
banee = llDeleteSubList(banee, 0, 0);
}
// GC
banee = [];
state get_banee_roles;
@@ -436,6 +445,11 @@
llHTTPResponse(id, 200, "OK");
if(wasKeyValueGet("command", body) != "getmemberroles" ||
wasKeyValueGet("success", body) != "True") {
if(wasKeyValueGet("status", body) == "19862") {
// DEBUG
llOwnerSay("[Unban] User not in group, but proceeding anyway...");
jump continue;
}
// DEBUG
llOwnerSay("[Unban] Unable to get member roles: " +
wasURLUnescape(
@@ -456,7 +470,9 @@
state tell;
}
state ban;
@continue;
 
state unban;
}
timer() {
llReleaseURL(URL);
@@ -477,7 +493,7 @@
}
}
 
state ban {
state unban {
state_entry() {
// DEBUG
llOwnerSay("[Unban] Unbanning...");
@@ -488,7 +504,7 @@
),
wasKeyValueEncode(
[
"command", "unban",
"command", "ban",
"group", wasURLEscape(
wasKeyValueGet(
"group",
@@ -501,6 +517,7 @@
configuration
)
),
"soft", soft,
"action", "unban",
"avatars", wasURLEscape(
wasListToCSV(
@@ -529,7 +546,7 @@
state listen_group;
}
data = "Hasta la vista, baby!";
data = "They'll be bak!";
state tell;
}
@@ -581,6 +598,10 @@
]
)
);
// reset variables.
soft = "True";
state listen_group;
}
}