Small adjustments to Bots.cs

Added DisconnectAndExit() to bot API
Scripting bot now unloads on script end
This commit is contained in:
ORelio 2013-07-20 21:27:50 +02:00
parent e31866f54b
commit 1ca38195bc

View file

@ -217,6 +217,15 @@ namespace MinecraftClient
Program.Restart();
}
/// <summary>
/// Disconnect from the server and exit the program
/// </summary>
protected void DisconnectAndExit()
{
Program.Exit();
}
/// <summary>
/// Unload the chatbot, and release associated memory.
/// </summary>
@ -899,7 +908,7 @@ namespace MinecraftClient
sleepticks = ticks;
break;
case "disconnect":
Program.Exit();
DisconnectAndExit();
break;
case "exit": //Exit bot & stay connected to the server
UnloadBot();
@ -911,6 +920,7 @@ namespace MinecraftClient
else
{
//No more instructions to interpret
UnloadBot();
}
}
}