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();
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue