+ Made MCC commands ignore case.

+ Started executing script when called with "/exec <scriptname>"
This commit is contained in:
bearbear12345 2013-11-04 19:48:29 +11:00
parent 07ac3268cc
commit 6340feaa52

View file

@ -171,7 +171,7 @@ namespace MinecraftClient
} }
else else
{ {
if (text == "/quit" || text == "/reco" || text == "/reconnect") { break; } if (text.ToLower() == "/quit" || text.ToLower().StartsWith("/exec ") || text.ToLower() == "/reco" || text.ToLower() == "/reconnect") { break; }
while (text.Length > 0 && text[0] == ' ') { text = text.Substring(1); } while (text.Length > 0 && text[0] == ' ') { text = text.Substring(1); }
if (text != "") if (text != "")
{ {
@ -200,13 +200,18 @@ namespace MinecraftClient
} }
} }
if (text == "/quit") if (text.ToLower() == "/quit")
{ {
ConsoleIO.WriteLine("You have left the server."); ConsoleIO.WriteLine("You have left the server.");
Disconnect(); Disconnect();
} }
else if (text == "/reco" || text == "/reconnect") else if (text.ToLower().StartsWith("/exec ")) {
handler.BotLoad(new Bots.Scripting("config/" + text.Split()[1]));
}
else if (text.ToLower() == "/reco" || text.ToLower() == "/reconnect")
{ {
ConsoleIO.WriteLine("You have left the server."); ConsoleIO.WriteLine("You have left the server.");
handler.SendRespawnPacket(); handler.SendRespawnPacket();