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

@ -182,14 +182,14 @@ namespace MinecraftClient.ChatBots
public override void GetText(string text)
{
//Remove colour codes
text = getVerbatim(text).ToLower();
text = GetVerbatim(text).ToLower();
//Check if this is a valid message
string sender = "", message = "";
bool chatMessage = isChatMessage(text, ref message, ref sender);
bool chatMessage = IsChatMessage(text, ref message, ref sender);
bool privateMessage = false;
if (!chatMessage)
privateMessage = isPrivateMessage(text, ref message, ref sender);
privateMessage = IsPrivateMessage(text, ref message, ref sender);
//Process only chat messages sent by another user
if ((chatMessage || privateMessage) && sender != Settings.Username)
@ -201,7 +201,7 @@ namespace MinecraftClient.ChatBots
{
string response = null;
LogToConsole(header + toPerform);
performInternalCommand(toPerform, ref response);
PerformInternalCommand(toPerform, ref response);
if (!String.IsNullOrEmpty(response))
LogToConsole(header + response);
}