Minecraft-Console-Client/MinecraftClient/ChatBots/RemoteControl.cs
ORelio 87d4687394 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
2014-06-14 18:48:43 +02:00

33 lines
992 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.ChatBots
{
/// <summary>
/// Allow to perform operations using whispers to the bot
/// </summary>
public class RemoteControl : ChatBot
{
public override void GetText(string text)
{
text = getVerbatim(text);
string command = "", sender = "";
if (isPrivateMessage(text, ref command, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
{
string response = "";
performInternalCommand(command, ref response);
if (response.Length > 0)
{
SendPrivateMessage(sender, response);
}
}
else if (isTeleportRequest(text, ref sender) && Settings.Bots_Owners.Contains(sender.ToLower()))
{
SendText("/tpaccept");
}
}
}
}