public static int[] InitializeTargetIVs(PokeTradeHub <PK8> hub) { int[] targetIVs = { -1, -1, -1, -1, -1, -1 }; /* Populate targetIVs array. Bot matches 0 and 31 IVs. * Any other nonzero IV is treated as a minimum accepted value. * If they put "x", this is a wild card so we can leave -1. */ string[] splitIVs = hub.Config.StopConditions.TargetIVs.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); // Only accept up to 6 values in case people can't count. for (int i = 0; i < 6 && i < splitIVs.Length; i++) { var str = splitIVs[i]; if (int.TryParse(str, out var val)) { targetIVs[i] = val; } } return(targetIVs); }
public EncounterBot(PokeBotConfig cfg, PokeTradeHub <PK8> Hub) : base(cfg) { hub = Hub; Counts = Hub.Counts; DumpSetting = Hub.Config.Folder; DesiredNature = Hub.Config.Encounter.DesiredNature; /* Populate DesiredIVs array. Bot matches 0 and 31 IVs. * Any other nonzero IV is treated as a minimum accepted value. * If they put "x", this is a wild card so we can leave -1. */ string[] splitIVs = Hub.Config.Encounter.DesiredIVs.Split(new [] { '/' }, StringSplitOptions.RemoveEmptyEntries); // Only accept up to 6 values in case people can't count. for (int i = 0; i < 6 && i < splitIVs.Length; i++) { if (splitIVs[i] == "x" || splitIVs[i] == "X") { continue; } DesiredIVs[i] = Convert.ToInt32(splitIVs[i]); } }
public RaidBot(PokeBotConfig cfg, PokeTradeHub <PK8> hub) : base(cfg) { Hub = hub; Settings = hub.Config.Raid; Counts = hub.Counts; }
public PokeTradeBot(PokeTradeHub <PK8> hub, PokeBotConfig cfg) : base(cfg) { Hub = hub; DumpSetting = hub.Config.Folder; GiveawaySetting = hub.Config.Giveaway; }
public BotEnvironmentImpl(PokeTradeHub <PK8> hub) : base(hub) { }
protected PokeBotRunner(PokeTradeHub <T> hub, BotFactory <T> factory) { Hub = hub; Factory = factory; }
public RaidBot(PokeBotState cfg, PokeTradeHub <PK8> hub) : base(cfg) { Hub = hub; Settings = hub.Config.Raid; }
public EncounterBotReset(PokeBotState cfg, PokeTradeHub <PK8> hub) : base(cfg, hub) { }
public BoolBot(PokeBotState cfg, PokeTradeHub <PK8> hub) : base(cfg, hub) { Settings = Hub.Config.Bool; }
protected PokeBotRunner(PokeTradeHub <PK8> hub) => Hub = hub;
public DenBot(PokeBotState cfg, PokeTradeHub <PK8> hub, RaidBot raid) : base(cfg) { Hub = hub; Settings = hub.Config.Den; Raid = raid; }
public TradeQueueManager(PokeTradeHub <T> hub) { Hub = hub; Info = new TradeQueueInfo <T>(hub); }
public OverworldBot(PokeBotState cfg, PokeTradeHub <PK8> hub) : base(cfg) { Hub = hub; Counts = Hub.Counts; }
private void GenerateCompletedTrades <T>(PokeTradeHub <T> hub) where T : PKM, new() { var msg = string.Format(CompletedTradesFormat, hub.Config.Trade.CompletedTrades); File.WriteAllText("completed.txt", msg); }
public void StartTrade <T>(PokeRoutineExecutorBase b, PokeTradeDetail <T> detail, PokeTradeHub <T> hub) where T : PKM, new() { if (!CreateAssets) { return; } try { if (CreateTradeStart) { GenerateBotConnection(b, detail); } if (CreateWaitedTime) { GenerateWaitedTime(detail.Time); } if (CreateEstimatedTime) { GenerateEstimatedTime(hub); } if (CreateUsersInQueue) { GenerateUsersInQueue(hub.Queues.Info.Count); } if (CreateOnDeck) { GenerateOnDeck(hub); } if (CreateOnDeck2) { GenerateOnDeck2(hub); } if (CreateUserList) { GenerateUserList(hub); } if (CreateCompletedTrades) { GenerateCompletedTrades(hub); } if (CreateTradeStartSprite) { GenerateBotSprite(b, detail); } } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) #pragma warning restore CA1031 // Do not catch general exception types { LogUtil.LogError(e.Message, nameof(StreamSettings)); } }
protected PokeBotRunner(PokeTradeHubConfig config, BotFactory <T> factory) { Factory = factory; Hub = new PokeTradeHub <T>(config); }
public PokeBotRunnerImpl(PokeTradeHub <PK8> hub) : base(hub) { }
private async Task <byte[]> DenData(PokeTradeHub <PK8> hub, CancellationToken token) => await Connection.ReadBytesAsync(DenUtil.GetDenOffset(hub), 0x18, token).ConfigureAwait(false);
public TradeExtensions(PokeTradeHub <PK8> hub) { Hub = hub; }
public PokeTradeBot(PokeTradeHub <PK8> hub, PokeBotConfig cfg) : base(cfg) => Hub = hub;
public override PokeRoutineExecutorBase CreateBot(PokeTradeHub <PB8> Hub, PokeBotState cfg) => cfg.NextRoutineType switch {
public static void InitializeTargetIVs(PokeTradeHub <PK8> hub, out int[] min, out int[] max) { min = ReadTargetIVs(hub.Config.StopConditions, true); max = ReadTargetIVs(hub.Config.StopConditions, false); return; }
public TradeQueueManager(PokeTradeHub <T> hub) { Hub = hub; Info = new TradeQueueInfo <T>(hub); AllQueues = new[] { Seed, Dump, Clone, Trade, }; }
public PokeBotRunnerImpl(PokeTradeHub <T> hub, BotFactory <T> fac) : base(hub, fac) { }
public TradeQueueInfo(PokeTradeHub <T> hub) => Hub = hub;
public EggBot(PokeTradeHub <PK8> hub, PokeBotConfig cfg) : base(cfg) { Counts = hub.Counts; DumpSetting = hub.Config; }
public QueueMonitor(PokeTradeHub <PK8> hub) => Hub = hub;
protected BotEnvironment(PokeTradeHub <PK8> hub) => Hub = hub;
public PokeTradeBot(PokeTradeHub <PK8> hub, PokeBotConfig cfg) : base(cfg) { Hub = hub; DumpSetting = hub.Config; }
public PokeTradeBot(PokeTradeHub <PK8> hub, PokeBotState cfg) : base(cfg) { Hub = hub; DumpSetting = hub.Config.Folder; }