Files
lsl-shell/modules/echo.lsl
Bridget 7cb06f01a8 Use unix-like exit codes
This currently uses the following mapping:
-1 : internal; for retrieving command info, sending commands, etc.
0 : success
1 : error
2020-04-27 00:32:19 +02:00

26 lines
630 B
Plaintext

string COMMAND = "echo";
string USAGE = \
"usage: echo [arg ...]
Repeat the given arguments.
";
default
{
link_message(integer sender, integer num, string msg, key id)
{
list params = llParseString2List(msg, [" "], [""]);
string param0 = llList2String(params, 0);
if(id == "get_commands")
{
llMessageLinked(LINK_SET, -1, COMMAND + "|" + USAGE, "command_info");
}
else if(param0 == COMMAND)
{
string response = llDumpList2String(llDeleteSubList(params, 0, 0), " ");
llMessageLinked(LINK_SET, 0, response, id);
}
}
}