mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Small adjustments to Bots.cs
Added DisconnectAndExit() to bot API Scripting bot now unloads on script end
This commit is contained in:
parent
e31866f54b
commit
1ca38195bc
1 changed files with 11 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue