mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Remove AutoLook.cs Chatbot because it is not in main project. Also removes it in McTcpClient.cs, and gets rid of the Settings.cs and Default paramaters.
This commit is contained in:
parent
384c804e54
commit
16959d6e65
4 changed files with 1 additions and 81 deletions
|
|
@ -1,66 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using MinecraftClient.Mapping;
|
|
||||||
|
|
||||||
namespace MinecraftClient.ChatBots
|
|
||||||
{
|
|
||||||
public class AutoLook : ChatBot
|
|
||||||
{
|
|
||||||
private Entity _entityToLookAt;
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
if (GetEntityHandlingEnabled() && GetTerrainEnabled()) return;
|
|
||||||
LogToConsole("Entity Handling or Terrain Handling is not enabled in the config file!");
|
|
||||||
LogToConsole("This bot will be unloaded.");
|
|
||||||
UnloadBot();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnEntityDespawn(Entity entity)
|
|
||||||
{
|
|
||||||
if (entity == _entityToLookAt)
|
|
||||||
{
|
|
||||||
_entityToLookAt = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public override void OnEntitySpawn(Entity entity)
|
|
||||||
{
|
|
||||||
HandleEntity(entity);
|
|
||||||
}
|
|
||||||
public override void OnEntityMove(Entity entity)
|
|
||||||
{
|
|
||||||
var tempBool = HandleEntity(entity);
|
|
||||||
LogDebugToConsole(tempBool);
|
|
||||||
if (!tempBool) return;
|
|
||||||
LookAtLocation(entity.Location);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles an entity, and tracks it if it is closer then the one we are currently tracking
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>True if found</returns>
|
|
||||||
private bool HandleEntity(Entity entity)
|
|
||||||
{
|
|
||||||
if (entity.Type != EntityType.Player)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (_entityToLookAt == null)
|
|
||||||
{
|
|
||||||
_entityToLookAt = entity;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (GetCurrentLocation().Distance(entity.Location) < GetCurrentLocation().Distance(_entityToLookAt.Location))
|
|
||||||
{
|
|
||||||
_entityToLookAt = entity;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity.ID != _entityToLookAt.ID) return false;
|
|
||||||
_entityToLookAt = entity; //Handle looking at the same entity
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -170,7 +170,6 @@ namespace MinecraftClient
|
||||||
if (Settings.AutoAttack_Enabled) { BotLoad(new ChatBots.AutoAttack()); }
|
if (Settings.AutoAttack_Enabled) { BotLoad(new ChatBots.AutoAttack()); }
|
||||||
if (Settings.AutoFishing_Enabled) { BotLoad(new ChatBots.AutoFishing()); }
|
if (Settings.AutoFishing_Enabled) { BotLoad(new ChatBots.AutoFishing()); }
|
||||||
if (Settings.AutoEat_Enabled) { BotLoad(new ChatBots.AutoEat(Settings.AutoEat_hungerThreshold)); }
|
if (Settings.AutoEat_Enabled) { BotLoad(new ChatBots.AutoEat(Settings.AutoEat_hungerThreshold)); }
|
||||||
if (Settings.AutoLook_Enabled) { BotLoad(new ChatBots.AutoLook()); }
|
|
||||||
|
|
||||||
//Add your ChatBot here by uncommenting and adapting
|
//Add your ChatBot here by uncommenting and adapting
|
||||||
//BotLoad(new ChatBots.YourBot());
|
//BotLoad(new ChatBots.YourBot());
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@
|
||||||
<Compile Include="ChatBots\AutoAttack.cs" />
|
<Compile Include="ChatBots\AutoAttack.cs" />
|
||||||
<Compile Include="ChatBots\AutoEat.cs" />
|
<Compile Include="ChatBots\AutoEat.cs" />
|
||||||
<Compile Include="ChatBots\AutoFishing.cs" />
|
<Compile Include="ChatBots\AutoFishing.cs" />
|
||||||
<Compile Include="ChatBots\AutoLook.cs" />
|
|
||||||
<Compile Include="ChatBots\AutoRespond.cs" />
|
<Compile Include="ChatBots\AutoRespond.cs" />
|
||||||
<Compile Include="ChatBots\AutoRelog.cs" />
|
<Compile Include="ChatBots\AutoRelog.cs" />
|
||||||
<Compile Include="ChatBots\ChatLog.cs" />
|
<Compile Include="ChatBots\ChatLog.cs" />
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ namespace MinecraftClient
|
||||||
private static readonly Dictionary<string, KeyValuePair<string, string>> Accounts = new Dictionary<string, KeyValuePair<string, string>>();
|
private static readonly Dictionary<string, KeyValuePair<string, string>> Accounts = new Dictionary<string, KeyValuePair<string, string>>();
|
||||||
private static readonly Dictionary<string, KeyValuePair<string, ushort>> Servers = new Dictionary<string, KeyValuePair<string, ushort>>();
|
private static readonly Dictionary<string, KeyValuePair<string, ushort>> Servers = new Dictionary<string, KeyValuePair<string, ushort>>();
|
||||||
|
|
||||||
private enum ParseMode { Default, Main, AppVars, Proxy, MCSettings, AntiAFK, Hangman, Alerts, ChatLog, AutoRelog, ScriptScheduler, RemoteControl, ChatFormat, AutoRespond, AutoAttack, AutoFishing, AutoEat, AutoLook };
|
private enum ParseMode { Default, Main, AppVars, Proxy, MCSettings, AntiAFK, Hangman, Alerts, ChatLog, AutoRelog, ScriptScheduler, RemoteControl, ChatFormat, AutoRespond, AutoAttack, AutoFishing, AutoEat };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load settings from the give INI file
|
/// Load settings from the give INI file
|
||||||
|
|
@ -214,7 +214,6 @@ namespace MinecraftClient
|
||||||
case "autoattack": pMode = ParseMode.AutoAttack; break;
|
case "autoattack": pMode = ParseMode.AutoAttack; break;
|
||||||
case "autofishing": pMode = ParseMode.AutoFishing; break;
|
case "autofishing": pMode = ParseMode.AutoFishing; break;
|
||||||
case "autoeat": pMode = ParseMode.AutoEat; break;
|
case "autoeat": pMode = ParseMode.AutoEat; break;
|
||||||
case "autolook": pMode = ParseMode.AutoLook; break;
|
|
||||||
default: pMode = ParseMode.Default; break;
|
default: pMode = ParseMode.Default; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -470,13 +469,6 @@ namespace MinecraftClient
|
||||||
case "matchesfile": AutoRespond_Matches = argValue; break;
|
case "matchesfile": AutoRespond_Matches = argValue; break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ParseMode.AutoLook:
|
|
||||||
switch (argName.ToLower())
|
|
||||||
{
|
|
||||||
case "enabled": AutoLook_Enabled = str2bool(argValue); break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ParseMode.AutoAttack:
|
case ParseMode.AutoAttack:
|
||||||
switch (argName.ToLower())
|
switch (argName.ToLower())
|
||||||
{
|
{
|
||||||
|
|
@ -705,10 +697,6 @@ namespace MinecraftClient
|
||||||
+ "# Inventory Handling NEED to be enabled first\r\n"
|
+ "# Inventory Handling NEED to be enabled first\r\n"
|
||||||
+ "enabled=false\r\n"
|
+ "enabled=false\r\n"
|
||||||
+ "threshold=6\r\n"
|
+ "threshold=6\r\n"
|
||||||
+ "\r\n"
|
|
||||||
+ "[AutoLook]\r\n"
|
|
||||||
+ "# Entity Handling AND Terrain Handling NEEDS to be enabled first\r\n"
|
|
||||||
+ "enabled=false"
|
|
||||||
+ "\r\n", Encoding.UTF8);
|
+ "\r\n", Encoding.UTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue