Improve logging, auto respawn

See discussion in GitHub issue #918
This commit is contained in:
ORelio 2020-04-01 21:15:35 +02:00
parent e93f03bd4e
commit b01c50b792
7 changed files with 217 additions and 26 deletions

View file

@ -24,8 +24,8 @@ namespace MinecraftClient.ChatBots
{
if (!GetEntityHandlingEnabled())
{
ConsoleIO.WriteLine("[AutoAttack] Entity Handling is not enabled in the config file!");
ConsoleIO.WriteLine("[AutoAttack] This bot will be unloaded.");
LogToConsole("Entity Handling is not enabled in the config file!");
LogToConsole("This bot will be unloaded.");
UnloadBot();
}
}

View file

@ -26,8 +26,8 @@ namespace MinecraftClient.ChatBots
{
if (!GetEntityHandlingEnabled())
{
ConsoleIO.WriteLine("[AutoFishing] Entity Handling is not enabled in the config file!");
ConsoleIO.WriteLine("[AutoFishing] This bot will be unloaded.");
LogToConsole("Entity Handling is not enabled in the config file!");
LogToConsole("This bot will be unloaded.");
UnloadBot();
}
inventoryEnabled = GetInventoryEnabled();
@ -39,7 +39,7 @@ namespace MinecraftClient.ChatBots
{
if (GetCurrentLocation().Distance(entity.Location) < 2 && !isFishing)
{
ConsoleIO.WriteLine("Threw a fishing rod");
LogToConsole("Threw a fishing rod");
fishingRod = entity;
LastPos = entity.Location;
isFishing = true;
@ -93,14 +93,14 @@ namespace MinecraftClient.ChatBots
/// </summary>
public void OnCaughtFish()
{
ConsoleIO.WriteLine(GetTimestamp()+": Caught a fish!");
LogToConsole(GetTimestamp() + ": Caught a fish!");
// retract fishing rod
UseItemOnHand();
if (inventoryEnabled)
{
if (!hasFishingRod())
{
ConsoleIO.WriteLine(GetTimestamp() + ": No Fishing Rod on hand. Maybe broken?");
LogToConsole(GetTimestamp() + ": No Fishing Rod on hand. Maybe broken?");
return;
}
}