Add support for %username% on log & task files

- Allows to use different files depending on the username
- Also, added a setting for disabling "beep" sound in Alerts bot
This commit is contained in:
ORelio 2014-05-10 21:03:03 +02:00
parent 22c47e99c2
commit 49a2d2b681
3 changed files with 7 additions and 9 deletions

View file

@ -610,7 +610,7 @@ namespace MinecraftClient
if (ok) if (ok)
{ {
Console.Beep(); //Text found ! if (Settings.Alerts_Beep_Enabled) { Console.Beep(); } //Text found !
if (ConsoleIO.basicIO) { ConsoleIO.WriteLine(comp.Replace(alert, "§c" + alert + "§r")); } else { if (ConsoleIO.basicIO) { ConsoleIO.WriteLine(comp.Replace(alert, "§c" + alert + "§r")); } else {

View file

@ -159,11 +159,10 @@ namespace MinecraftClient
if (Settings.AntiAFK_Enabled) { handler.BotLoad(new Bots.AntiAFK(Settings.AntiAFK_Delay)); } if (Settings.AntiAFK_Enabled) { handler.BotLoad(new Bots.AntiAFK(Settings.AntiAFK_Delay)); }
if (Settings.Hangman_Enabled) { handler.BotLoad(new Bots.Pendu(Settings.Hangman_English)); } if (Settings.Hangman_Enabled) { handler.BotLoad(new Bots.Pendu(Settings.Hangman_English)); }
if (Settings.Alerts_Enabled) { handler.BotLoad(new Bots.Alerts()); } if (Settings.Alerts_Enabled) { handler.BotLoad(new Bots.Alerts()); }
if (Settings.ChatLog_Enabled) { handler.BotLoad(new Bots.ChatLog(Settings.ChatLog_File, Settings.ChatLog_Filter, Settings.ChatLog_DateTime)); } if (Settings.ChatLog_Enabled) { handler.BotLoad(new Bots.ChatLog(Settings.ChatLog_File.Replace("%username%", Settings.Username), Settings.ChatLog_Filter, Settings.ChatLog_DateTime)); }
if (Settings.PlayerLog_Enabled) { handler.BotLoad(new Bots.PlayerListLogger(Settings.PlayerLog_Delay, Settings.PlayerLog_File)); } if (Settings.PlayerLog_Enabled) { handler.BotLoad(new Bots.PlayerListLogger(Settings.PlayerLog_Delay, Settings.PlayerLog_File.Replace("%username%", Settings.Username))); }
if (Settings.AutoRelog_Enabled) { handler.BotLoad(new Bots.AutoRelog(Settings.AutoRelog_Delay, Settings.AutoRelog_Retries)); } if (Settings.AutoRelog_Enabled) { handler.BotLoad(new Bots.AutoRelog(Settings.AutoRelog_Delay, Settings.AutoRelog_Retries)); }
if (Settings.StartupScript_Enabled) { handler.BotLoad(new Bots.Script(Settings.StartupScript_ScriptFile)); Settings.StartupScript_Enabled = false; } if (Settings.ScriptScheduler_Enabled) { handler.BotLoad(new Bots.ScriptScheduler(Settings.ScriptScheduler_TasksFile.Replace("%username%", Settings.Username))); }
if (Settings.ScriptScheduler_Enabled) { handler.BotLoad(new Bots.ScriptScheduler(Settings.ScriptScheduler_TasksFile)); }
if (Settings.RemoteCtrl_Enabled) { handler.BotLoad(new Bots.RemoteControl()); } if (Settings.RemoteCtrl_Enabled) { handler.BotLoad(new Bots.RemoteControl()); }
//Start the main TCP client //Start the main TCP client

View file

@ -44,6 +44,7 @@ namespace MinecraftClient
//Alerts Settings //Alerts Settings
public static bool Alerts_Enabled = false; public static bool Alerts_Enabled = false;
public static bool Alerts_Beep_Enabled = true;
public static string Alerts_MatchesFile = "alerts.txt"; public static string Alerts_MatchesFile = "alerts.txt";
public static string Alerts_ExcludesFile = "alerts-exclude.txt"; public static string Alerts_ExcludesFile = "alerts-exclude.txt";
@ -64,10 +65,6 @@ namespace MinecraftClient
public static int AutoRelog_Retries = 3; public static int AutoRelog_Retries = 3;
public static string AutoRelog_KickMessagesFile = "kickmessages.txt"; public static string AutoRelog_KickMessagesFile = "kickmessages.txt";
//Startup Script Settings
public static bool StartupScript_Enabled = false;
public static string StartupScript_ScriptFile = "script.txt";
//Script Scheduler Settings //Script Scheduler Settings
public static bool ScriptScheduler_Enabled = false; public static bool ScriptScheduler_Enabled = false;
public static string ScriptScheduler_TasksFile = "tasks.ini"; public static string ScriptScheduler_TasksFile = "tasks.ini";
@ -142,6 +139,7 @@ namespace MinecraftClient
case "enabled": Alerts_Enabled = str2bool(argValue); break; case "enabled": Alerts_Enabled = str2bool(argValue); break;
case "alertsfile": Alerts_MatchesFile = argValue; break; case "alertsfile": Alerts_MatchesFile = argValue; break;
case "excludesfile": Alerts_ExcludesFile = argValue; break; case "excludesfile": Alerts_ExcludesFile = argValue; break;
case "beeponalert": Alerts_Beep_Enabled = str2bool(argValue); break;
} }
break; break;
@ -239,6 +237,7 @@ namespace MinecraftClient
+ "enabled=false\r\n" + "enabled=false\r\n"
+ "alertsfile=alerts.txt\r\n" + "alertsfile=alerts.txt\r\n"
+ "excludesfile=alerts-exclude.txt\r\n" + "excludesfile=alerts-exclude.txt\r\n"
+ "beeponalert=true\r\n"
+ "\r\n" + "\r\n"
+ "[AntiAFK]\r\n" + "[AntiAFK]\r\n"
+ "enabled=false\r\n" + "enabled=false\r\n"