mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add set varname=value MCC command
- Allow to use vars declared in scripts or directly by the user - Commands my now use %variable% as well - Moved "help" command from RemoteControl to inner MCC command manager - The only special command is "wait", which is only available in scripts Todo: Solve ambiguity between MCC help and Server help commands Note: Auto accept tpa suggested by MousePak Note: Manually choosing MC version suggested by ZizzyDizzyMC
This commit is contained in:
parent
8b5ce567a6
commit
87d4687394
5 changed files with 96 additions and 76 deletions
|
|
@ -17,33 +17,11 @@ namespace MinecraftClient.ChatBots
|
|||
string command = "", sender = "";
|
||||
if (isPrivateMessage(text, ref command, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
|
||||
{
|
||||
string cmd_name = command.Split(' ')[0];
|
||||
switch (cmd_name.ToLower())
|
||||
string response = "";
|
||||
performInternalCommand(command, ref response);
|
||||
if (response.Length > 0)
|
||||
{
|
||||
case "help":
|
||||
if (command.Length >= 6)
|
||||
{
|
||||
string help_cmd_name = command.Substring(5).ToLower();
|
||||
switch (help_cmd_name)
|
||||
{
|
||||
case "exit": SendPrivateMessage(sender, "exit: disconnect from the server."); break;
|
||||
case "reco": SendPrivateMessage(sender, "reco: restart and reconnct to the server."); break;
|
||||
case "script": SendPrivateMessage(sender, "script <scriptname>: run a script file."); break;
|
||||
case "send": SendPrivateMessage(sender, "send <text>: send a chat message or command."); break;
|
||||
case "connect": SendPrivateMessage(sender, "connect <serverip>: connect to the specified server."); break;
|
||||
case "help": SendPrivateMessage(sender, "help <cmdname>: show brief help about a command."); break;
|
||||
default: SendPrivateMessage(sender, "help: unknown command '" + help_cmd_name + "'."); break;
|
||||
}
|
||||
}
|
||||
else SendPrivateMessage(sender, "help <cmdname>. Available commands: exit, reco, script, send, connect.");
|
||||
break;
|
||||
default:
|
||||
if (isInternalCommand(command))
|
||||
{
|
||||
performInternalCommand(command);
|
||||
}
|
||||
else SendPrivateMessage(sender, "Unknown command '" + cmd_name + "'. Use 'help' for help.");
|
||||
break;
|
||||
SendPrivateMessage(sender, response);
|
||||
}
|
||||
}
|
||||
else if (isTeleportRequest(text, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue