mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
- Now scripts can also be written in C# - C# scripts can access ChatBot API - Add more methods in ChatBot API - Add an example of C# script file - Coding style fixes: method names ucfirst
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
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().Trim()))
|
|
{
|
|
string response = "";
|
|
PerformInternalCommand(command, ref response);
|
|
if (response.Length > 0)
|
|
{
|
|
SendPrivateMessage(sender, response);
|
|
}
|
|
}
|
|
else if (Settings.RemoteCtrl_AutoTpaccept
|
|
&& IsTeleportRequest(text, ref sender)
|
|
&& (Settings.RemoteCtrl_AutoTpaccept_Everyone || Settings.Bots_Owners.Contains(sender.ToLower().Trim())))
|
|
{
|
|
SendText("/tpaccept");
|
|
}
|
|
}
|
|
}
|
|
}
|