public static void StartNextRound() { IPCChannel.Broadcast(new StartMessage() { MissionDifficulty = Config.GlobalSettings.MissionDifficulty, MissionFaction = Config.GlobalSettings.MissionFaction }); ActiveGlobalSettings = Config.GlobalSettings.Clone(); }
private static void StartNextRound() { IPCChannel.Broadcast(new StartMessage() { Sector = Config.GlobalSettings.Sector }); ActiveGlobalSettings = Config.GlobalSettings.Clone(); Chat.WriteLine("StartNextRound"); }
private void APFBuddyCommand(string command, string[] param, ChatWindow chatWindow) { try { if (param.Length < 1) { PrintAPFBuddyCommandUsage(chatWindow); return; } switch (param[0].ToLower()) { case "start": if (!Team.IsLeader) { chatWindow.WriteLine("Error: Only the team leader can use start", ChatColor.Yellow); return; } if (!Team.IsInTeam || !Team.IsRaid) { chatWindow.WriteLine("Error: Must be in a raid to start", ChatColor.Yellow); return; } if (!Inventory.Find(83919, out _) && !Inventory.Find(152028, out _)) { chatWindow.WriteLine("Error: You need an Aggression Enhancer/Aggression Multiplier in your main inventory to run this bot.", ChatColor.Yellow); return; } IsLeader = true; Start(); break; case "stop": Stop(); IPCChannel.Broadcast(new StopMessage()); break; case "config": if (param.Length == 1) { chatWindow.WriteLine($"APFBuddy Config:", ChatColor.LightBlue); chatWindow.WriteLine($"\tIsLeech({DynelManager.LocalPlayer.Name}): {Config.IsLeech}", ChatColor.LightBlue); return; } if (param.Length < 2) { PrintAPFBuddyCommandUsage(chatWindow); return; } switch (param[1].ToLower()) { case "isleech": if (param.Length == 2) { chatWindow.WriteLine($"IsLeech({DynelManager.LocalPlayer.Name}): {Config.IsLeech}", ChatColor.LightBlue); return; } bool leechValue; if (!bool.TryParse(param[2], out leechValue)) { chatWindow.WriteLine($"Invalid value. Options for isleech are [true|false]", ChatColor.Red); return; } if (Config.CharSettings == null) { Config.CharSettings = new Dictionary <int, CharacterSettings>(); } if (!Config.CharSettings.ContainsKey(Game.ClientInst)) { Config.CharSettings.Add(Game.ClientInst, new CharacterSettings() { IsLeech = leechValue }); } else { Config.CharSettings[Game.ClientInst].IsLeech = leechValue; } chatWindow.WriteLine($"IsLeech is now set to {leechValue}"); break; default: chatWindow.WriteLine($"Config options are [isleech]", ChatColor.Red); return; } Config.Save(); break; case "test": FSM.Fire(Trigger.StartNewRun); break; default: PrintAPFBuddyCommandUsage(chatWindow); break; } } catch (Exception e) { Chat.WriteLine(e.Message); } }
private void InfbuddyCommand(string command, string[] param, ChatWindow chatWindow) { try { if (param.Length < 1) { PrintInfBuddyCommandUsage(chatWindow); return; } switch (param[0].ToLower()) { case "start": if (!Team.IsLeader) { chatWindow.WriteLine("Only the team leader can use start", ChatColor.Yellow); return; } IsLeader = true; Start(); StartNextRound(); break; case "stop": Stop(); IPCChannel.Broadcast(new StopMessage()); break; case "config": if (param.Length == 1) { chatWindow.WriteLine($"Infbuddy Config:", ChatColor.LightBlue); chatWindow.WriteLine($"\tMissionDifficulty(Global): {Config.GlobalSettings.MissionDifficulty}", ChatColor.LightBlue); chatWindow.WriteLine($"\tMissionFaction(Global): {Config.GlobalSettings.MissionFaction}", ChatColor.LightBlue); chatWindow.WriteLine($"\tIsLeech({DynelManager.LocalPlayer.Name}): {Config.IsLeech}", ChatColor.LightBlue); return; } if (param.Length < 2) { PrintInfBuddyCommandUsage(chatWindow); return; } switch (param[1].ToLower()) { case "difficulty": if (param.Length == 2) { chatWindow.WriteLine($"MissionDifficulty(Global): {Config.GlobalSettings.MissionDifficulty}", ChatColor.LightBlue); return; } MissionDifficulty difficultyValue; if (!Enum.TryParse(param[2], true, out difficultyValue)) { chatWindow.WriteLine($"Invalid value. Options for difficulty are [{string.Join("|", Enum.GetNames(typeof(MissionDifficulty)))}]", ChatColor.Red); return; } Config.GlobalSettings.MissionDifficulty = difficultyValue; chatWindow.WriteLine($"Difficulty is now set to {difficultyValue}"); break; case "faction": if (param.Length == 2) { chatWindow.WriteLine($"MissionFaction(Global): {Config.GlobalSettings.MissionFaction}", ChatColor.LightBlue); return; } MissionFaction factionValue; if (!Enum.TryParse(param[2], true, out factionValue)) { chatWindow.WriteLine($"Invalid value. Options for faction are [{string.Join("|", Enum.GetNames(typeof(MissionFaction)))}]", ChatColor.Red); return; } Config.GlobalSettings.MissionFaction = factionValue; chatWindow.WriteLine($"Faction is now set to {factionValue}"); break; case "isleech": if (param.Length == 2) { chatWindow.WriteLine($"IsLeech({DynelManager.LocalPlayer.Name}): {Config.IsLeech}", ChatColor.LightBlue); return; } bool leechValue; if (!bool.TryParse(param[2], out leechValue)) { chatWindow.WriteLine($"Invalid value. Options for isleech are [true|false]", ChatColor.Red); return; } if (Config.CharSettings == null) { Config.CharSettings = new Dictionary <int, CharacterSettings>(); } if (!Config.CharSettings.ContainsKey(Game.ClientInst)) { Config.CharSettings.Add(Game.ClientInst, new CharacterSettings() { IsLeech = leechValue }); } else { Config.CharSettings[Game.ClientInst].IsLeech = leechValue; } chatWindow.WriteLine($"IsLeech is now set to {leechValue}"); break; default: chatWindow.WriteLine($"Config options are [difficulty|faction|isleech]", ChatColor.Red); return; } Config.Save(); break; case "test": _stateMachine.SetState(new MoveToQuestGiverState()); break; default: PrintInfBuddyCommandUsage(chatWindow); break; } } catch (Exception e) { Chat.WriteLine(e.Message); } }