Implemented the Follow Player chat bot.

This commit is contained in:
Milutinke 2022-09-09 15:39:41 +02:00
parent 223c13561c
commit c7ba5e5fa3
5 changed files with 225 additions and 4 deletions

View file

@ -230,6 +230,11 @@ namespace MinecraftClient
public static bool ReplayMod_Enabled = false;
public static int ReplayMod_BackupInterval = 3000;
// Follow Player
public static bool FollowPlayer_Enabled = false;
public static int FollowPlayer_UpdateLimit = 10;
public static int FollowPlayer_StopAtDistance = 3;
//Custom app variables and Minecraft accounts
private static readonly Dictionary<string, object> AppVars = new Dictionary<string, object>();
private static readonly Dictionary<string, KeyValuePair<string, string>> Accounts = new Dictionary<string, KeyValuePair<string, string>>();
@ -239,7 +244,7 @@ namespace MinecraftClient
private static string ServerAliasTemp = null;
//Mapping for settings sections in the INI file
private enum Section { Default, Main, AppVars, Proxy, MCSettings, AntiAFK, Hangman, Alerts, ChatLog, AutoRelog, ScriptScheduler, RemoteControl, ChatFormat, AutoRespond, AutoAttack, AutoFishing, AutoEat, AutoCraft, AutoDrop, Mailer, ReplayMod, Logging, Signature };
private enum Section { Default, Main, AppVars, Proxy, MCSettings, AntiAFK, Hangman, Alerts, ChatLog, AutoRelog, ScriptScheduler, RemoteControl, ChatFormat, AutoRespond, AutoAttack, AutoFishing, AutoEat, AutoCraft, AutoDrop, Mailer, ReplayMod, FollowPlayer, Logging, Signature };
/// <summary>
/// Get settings section from name
@ -816,6 +821,15 @@ namespace MinecraftClient
case "backupinterval": ReplayMod_BackupInterval = str2int(argValue); return true;
}
break;
case Section.FollowPlayer:
switch (ToLowerIfNeed(argName))
{
case "enabled": FollowPlayer_Enabled = str2bool(argValue); return true;
case "update_limit": FollowPlayer_UpdateLimit = str2int(argValue); return true;
case "stop_at_distance": FollowPlayer_StopAtDistance = str2int(argValue); return true;
}
break;
}
return false;
}