corrade-lsl-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 14  →  ?path2? @ 15
/source/eggdrop/ban.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) != "ban")
list command = llParseString2List(data, [" "], []);
if(llList2String(command, 0) !=
wasKeyValueGet("command", configuration) + "ban")
return;
// Remove command.
command = llDeleteSubList(command, 0, 0);
firstname = wasKeyValueGet("firstname", message);
lastname = wasKeyValueGet("lastname", message);
@@ -253,10 +257,7 @@
data = "And who would yarr be?";
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("[Ban] User not in group, but proceeding anyway...");
jump continue;
}
// DEBUG
llOwnerSay("[Ban] Unable to get member roles: " +
wasURLUnescape(
@@ -446,12 +460,13 @@
state listen_group;
}
@continue;
string result = wasURLUnescape(
wasKeyValueGet("data", body)
);
if(result != "" && llListFindList(wasCSVToList(result), (list)"Owners") != -1) {
data = "Ejectee is an owner. I'm not gonna open the pod bay doors.";
data = "Ejectee is an owner. I'm not gunna open the pod bay doors.";
llReleaseURL(URL);
state tell;
}
@@ -501,6 +516,7 @@
configuration
)
),
"soft", soft,
"action", "ban",
"avatars", wasURLEscape(
wasListToCSV(
@@ -582,6 +598,10 @@
]
)
);
// reset variables.
soft = "True";
state listen_group;
}
}