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