Add support for C# scripts in scripting bot

- 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
This commit is contained in:
ORelio 2015-06-20 22:58:18 +02:00
parent 3224c59eab
commit 3ce91188c7
22 changed files with 321 additions and 135 deletions

View file

@ -17,13 +17,13 @@ namespace MinecraftClient.Commands
string[] args = getArgs(command);
if (args.Length > 1)
{
if (!Settings.setAccount(args[1]))
if (!Settings.SetAccount(args[1]))
{
return "Unknown account '" + args[1] + "'.";
}
}
if (Settings.setServerIP(args[0]))
if (Settings.SetServerIP(args[0]))
{
Program.Restart();
return "";

View file

@ -12,7 +12,7 @@ namespace MinecraftClient.Commands
public override string Run(McTcpClient handler, string command)
{
return "PlayerList: " + String.Join(", ", handler.getOnlinePlayers());
return "PlayerList: " + String.Join(", ", handler.GetOnlinePlayers());
}
}
}

View file

@ -15,7 +15,7 @@ namespace MinecraftClient.Commands
string[] args = getArgs(command);
if (args.Length > 0)
{
if (!Settings.setAccount(args[0]))
if (!Settings.SetAccount(args[0]))
{
return "Unknown account '" + args[0] + "'.";
}

View file

@ -17,7 +17,7 @@ namespace MinecraftClient.Commands
string[] temp = getArg(command).Split('=');
if (temp.Length > 1)
{
if (Settings.setVar(temp[0], getArg(command).Substring(temp[0].Length + 1)))
if (Settings.SetVar(temp[0], getArg(command).Substring(temp[0].Length + 1)))
{
return ""; //Success
}