示例#1
0
 internal static void SeedPokemons(BotWindowData bot)
 {
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Mew, "Mew the awesome!", 1337, 99.9,
                                           PokemonFamilyId.FamilyMew, 4200, 9001, true, true, 97, PokemonMove.Moonblast, PokemonMove.Thunder,
                                           PokemonType.Psychic, PokemonType.Flying, 9000, PokemonInfo.GetBaseStats(PokemonId.Mew), 90, 15, 100000,
                                           42, 15, 7, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, true));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Mewtwo, "Mr.Kickass", 9001, 100,
                                           PokemonFamilyId.FamilyMewtwo, 47, 9001, true, true, 97, PokemonMove.HyperBeam, PokemonMove.PsychoCutFast,
                                           PokemonType.Psychic, PokemonType.Flying, 10000, PokemonInfo.GetBaseStats(PokemonId.Mewtwo), 90, 0,
                                           100000, 42, 13, 15, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, false)); //PokemonId.Mew.ToInventorySource(),
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Zapdos, "Thunder", 1337, 100,
                                           PokemonFamilyId.FamilyZapdos, 47, 9001, true, true, 97, PokemonMove.HyperBeam, PokemonMove.PsychoCutFast,
                                           PokemonType.Psychic, PokemonType.Flying, 3000, PokemonInfo.GetBaseStats(PokemonId.Zapdos), 90, 4, 100000,
                                           42, 10, 15, 0.732f, 101, 100, new[] { PokemonId.Mewtwo, }, false));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Articuno, "Ice-ice-baby", 4048, 100,
                                           PokemonFamilyId.FamilyArticuno, 47, 9001, true, true, 97, PokemonMove.HyperBeam,
                                           PokemonMove.PsychoCutFast, PokemonType.Psychic, PokemonType.Flying, 5000,
                                           PokemonInfo.GetBaseStats(PokemonId.Articuno), 90, 5, 100000, 42, 7, 9, 0.732f, 101, 100,
                                           new[] { PokemonId.Mewtwo, PokemonId.Articuno }, false));
     bot.PokemonList.Add(new PokemonUiData(bot, 123455678, PokemonId.Moltres, "Popcorn machine", 4269, 100,
                                           PokemonFamilyId.FamilyMoltres, 47, 9001, true, true, 97, PokemonMove.HyperBeam,
                                           PokemonMove.PsychoCutFast, PokemonType.Psychic, PokemonType.Flying, 5000,
                                           PokemonInfo.GetBaseStats(PokemonId.Moltres), 90, 13, 100000, 42, 14, 15, 0.732f, 101, 100,
                                           new[] { PokemonId.Mewtwo, }, false));
 }
示例#2
0
 internal static void SeedTestConsole(BotWindowData bot)
 {
     bot.LogQueue.Enqueue(
         Tuple.Create(
             "Check fresh updates at https://github.com/Lunat1q/Catchem-PoGo and join our friendly Discord chat: https://discord.me/Catchem",
             Colors.LawnGreen));
 }
示例#3
0
        internal static void SeedPokedex(BotWindowData bot)
        {
            var bulbasaur = bot.PokeDex.FirstOrDefault(x => x.Id == PokemonId.Bulbasaur);

            if (bulbasaur != null)
            {
                bulbasaur.CapturedTimes = 16;
                bulbasaur.SeenTimes     = 24;
            }
            var charizard = bot.PokeDex.FirstOrDefault(x => x.Id == PokemonId.Charizard);

            if (charizard != null)
            {
                charizard.CapturedTimes = 1;
                charizard.SeenTimes     = 4;
            }

            var blastoise = bot.PokeDex.FirstOrDefault(x => x.Id == PokemonId.Blastoise);

            if (blastoise != null)
            {
                blastoise.CapturedTimes = 0;
                blastoise.SeenTimes     = 1;
            }
        }
示例#4
0
        internal static void SeedEggs(BotWindowData bot)
        {
            bot.EggList.Add(new PokeEgg()
            {
                Distance         = 5,
                EggId            = 12123124123,
                EggIncubatorId   = "ewqe1231231221",
                IncubatorType    = ItemId.ItemIncubatorBasicUnlimited,
                PokemonUidInside = 123123123,
                TargetDistance   = 38,
                WalkedDistance   = 35.2
            });

            bot.EggList.Add(new PokeEgg()
            {
                Distance         = 10,
                EggId            = 12123121234123,
                EggIncubatorId   = "ewqe1212331231221",
                IncubatorType    = ItemId.ItemIncubatorBasic,
                PokemonUidInside = 312312123,
                TargetDistance   = 43,
                WalkedDistance   = 35.2
            });

            bot.EggList.Add(new PokeEgg()
            {
                Distance         = 10,
                EggId            = 1223,
                EggIncubatorId   = "",
                PokemonUidInside = 0,
                TargetDistance   = 10,
                WalkedDistance   = 35.2
            });
        }
 public void SetBot(BotWindowData bot)
 {
     _bot = bot;
     UpdatePlayerTab();
     UpdateLists();
     Dispatcher.Invoke(new ThreadStart(UpdateRunTimeData));
 }
示例#6
0
        public void SetBot(BotWindowData bot)
        {
            LoadingUi            = true;
            Bot                  = bot;
            authBox.SelectedItem = Bot.GlobalSettings.Auth.AuthType;
            if (Bot.GlobalSettings.Auth.AuthType == AuthType.Google)
            {
                loginBox.Text        = Bot.GlobalSettings.Auth.GoogleUsername;
                passwordBox.Password = Bot.GlobalSettings.Auth.GooglePassword;
            }
            else
            {
                loginBox.Text        = Bot.GlobalSettings.Auth.PtcUsername;
                passwordBox.Password = Bot.GlobalSettings.Auth.PtcPassword;
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <TextBox>())
            {
                string val;
                if (UiHandlers.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.Text = val;
                }
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <PasswordBox>())
            {
                string val;
                if (UiHandlers.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.Password = val;
                }
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <CheckBox>())
            {
                bool val;
                if (UiHandlers.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.IsChecked = val;
                }
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <ComboBox>())
            {
                Enum val;
                if (UiHandlers.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    var valType = val.GetType();
                    uiElem.ItemsSource  = Enum.GetValues(valType);
                    uiElem.SelectedItem = val;
                }
            }

            CustomRouteComboBox.SelectedItem =
                _globalSettings.Routes.FirstOrDefault(x => x.Name == Bot.GlobalSettings.LocationSettings.CustomRouteName);


            LoadingUi = false;
        }
示例#7
0
 // ReSharper disable once InconsistentNaming
 private void StatsOnDirtyEvent(BotWindowData _bot)
 {
     if (_bot == null)
     {
         throw new ArgumentNullException(nameof(_bot));
     }
     Dispatcher.BeginInvoke(new ThreadStart(_bot.UpdateXppH));
     if (Bot == _bot)
     {
         Dispatcher.BeginInvoke(new ThreadStart(delegate
         {
             Playername.Content        = _curSession.Profile?.PlayerData?.Username;
             l_StarDust.Content        = Bot.Stats?.TotalStardust;
             l_Stardust_farmed.Content = Bot.Stats?.TotalStardust == 0 ? 0 : Bot.Stats?.TotalStardust - _curSession?.Profile?.PlayerData?.Currencies[1].Amount;
             l_xp.Content                  = Bot.Stats?.ExportStats?.CurrentXp;
             l_xp_farmed.Content           = Bot.Stats?.TotalExperience;
             l_coins.Content               = _curSession.Profile?.PlayerData?.Currencies[0].Amount;
             l_Pokemons_farmed.Content     = Bot.Stats?.TotalPokemons;
             l_Pokemons_transfered.Content = Bot.Stats?.TotalPokemonsTransfered;
             l_Pokestops_farmed.Content    = Bot.Stats?.TotalPokestops;
             l_level.Content               = Bot.Stats?.ExportStats?.Level;
             l_level_nextime.Content       = $"{Bot.Stats?.ExportStats?.HoursUntilLvl.ToString("00")}:{Bot.Stats?.ExportStats?.MinutesUntilLevel.ToString("00")}";
         }));
     }
 }
示例#8
0
 public void SetBot(BotWindowData bot)
 {
     _loadingUi = true;
     _bot       = bot;
     UpdatePokedexCount();
     UpdateLists();
     _loadingUi = false;
 }
示例#9
0
 internal static void SeedTheBot(BotWindowData bot)
 {
     SeedEggs(bot);
     SeedTestConsole(bot);
     SeedPokemons(bot);
     SeedPokedex(bot);
     SeedItems(bot);
 }
 public void SetBot(BotWindowData bot)
 {
     BotSettingsPage.SetBot(bot);
     BotPlayerPage.SetBot(bot);
     BotPokemonListPage.SetBot(bot);
     BotMapPage.SetBot(bot);
     BotPokePage.SetBot(bot);
     BotPokedexPage.SetBot(bot);
 }
示例#11
0
 public void SetBot(BotWindowData bot)
 {
     _loadingUi = true;
     _bot       = bot;
     UpdatePlayerTab();
     UpdateLists();
     _loadingUi = false;
     UpdateRunTimeData();
 }
示例#12
0
 public void ClearPokemonData(BotWindowData calledBot)
 {
     if (Bot != calledBot)
     {
         return;
     }
     SettingsView.consoleBox.Document.Blocks.Clear();
     Bot.LatStep = Bot.LngStep = 0;
     SettingsView.BotMapPage.ClearData();
     SettingsView.BotPlayerPage.ClearData();
 }
示例#13
0
        private static void SeedItems(BotWindowData bot)
        {
            var inc = new ItemUiData(ItemId.ItemIncenseOrdinary, "Incense", 5, bot);

            bot.ItemList.Add(inc);
            bot.UsedItem(ItemId.ItemIncenseOrdinary, DateTime.UtcNow.AddMinutes(19).ToUnixTime());
            var luckyEgg = new ItemUiData(ItemId.ItemLuckyEgg, "Lucky Egg", 5, bot);

            bot.ItemList.Add(luckyEgg);
            bot.UsedItem(ItemId.ItemLuckyEgg, DateTime.UtcNow.AddMinutes(0.2).ToUnixTime());
            bot.ItemList.Add(new ItemUiData(ItemId.ItemSpecialCamera, "Camera", 1, bot));
        }
示例#14
0
 private bool GetBotByIndex(long chatId, int botNum, out BotWindowData bot)
 {
     bot = MainWindow.BotsCollection.ElementAtOrDefault(botNum);
     if (bot == null)
     {
         return(false);
     }
     if (bot.Started)
     {
         return(true);
     }
     SendToTelegram("Bot needs to be started before you can run this command", chatId);
     return(false);
 }
示例#15
0
 public void SetBot(BotWindowData bot)
 {
     _loadingUi = true;
     _bot       = bot;
     LoadMarkersFromBot();
     if (_bot == null)
     {
         return;
     }
     pokeMap.Position = new PointLatLng(_bot.Lat, _bot.Lng);
     DrawPlayerMarker();
     UpdatePathRoute();
     sl_moveSpeedFactor.Value = _bot.GlobalSettings.LocationSettings.MoveSpeedFactor;
     _loadingUi = false;
 }
示例#16
0
 private void StatsOnDirtyEvent(BotWindowData bot)
 {
     if (bot == null)
     {
         return;
     }
     Dispatcher.BeginInvoke(new ThreadStart(bot.UpdateRunTime));
     if (Bot == bot)
     {
         Dispatcher.BeginInvoke(new ThreadStart(delegate
         {
             SettingsView.BotPlayerPage.UpdateRunTimeData();
         }));
     }
     bot.CheckForMaxCatch();
 }
示例#17
0
        public void SetBot(BotWindowData bot)
        {
            LoadingUi            = true;
            Bot                  = bot;
            authBox.SelectedItem = Bot.GlobalSettings.Auth.AuthType;
            if (Bot.GlobalSettings.Auth.AuthType == AuthType.Google)
            {
                loginBox.Text        = Bot.GlobalSettings.Auth.GoogleUsername;
                passwordBox.Password = Bot.GlobalSettings.Auth.GooglePassword;
            }
            else
            {
                loginBox.Text        = Bot.GlobalSettings.Auth.PtcUsername;
                passwordBox.Password = Bot.GlobalSettings.Auth.PtcPassword;
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <TextBox>())
            {
                string val;
                if (Extensions.Extensions.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.Text = val;
                }
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <PasswordBox>())
            {
                string val;
                if (Extensions.Extensions.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.Password = val;
                }
            }

            foreach (var uiElem in settings_grid.GetLogicalChildCollection <CheckBox>())
            {
                bool val;
                if (Extensions.Extensions.GetValueByName(uiElem.Name.Substring(2), Bot.GlobalSettings, out val))
                {
                    uiElem.IsChecked = val;
                }
            }

            LoadingUi = false;
        }
示例#18
0
        public void UpdateCurrentBotCoords(BotWindowData botReceiver)
        {
            botReceiver.MoveRequired = true;
            if (Math.Abs(botReceiver._lat) < 0.001 && Math.Abs(botReceiver._lng) < 0.001)
            {
                botReceiver._lat = botReceiver.Lat;
                botReceiver._lng = botReceiver.Lng;
                Dispatcher.BeginInvoke(
                    new ThreadStart(delegate { pokeMap.Position = new PointLatLng(botReceiver.Lat, botReceiver.Lng); }));
            }

            if (_playerMarker == null)
            {
                Dispatcher.BeginInvoke(new ThreadStart(DrawPlayerMarker));
            }
            else
            {
                botReceiver.GotNewCoord = true;
            }
        }
        private string GetWorkingRouting(out BotWindowData bot)
        {
            var botGoogle =
                MainWindow.BotsCollection.FirstOrDefault(
                    x => !string.IsNullOrEmpty(x.GlobalSettings.LocationSettings.GoogleDirectionsApiKey));

            var botMapzen =
                MainWindow.BotsCollection.FirstOrDefault(
                    x => !string.IsNullOrEmpty(x.GlobalSettings.LocationSettings.MapzenValhallaApiKey));

            bot = _prefferMapzen
                ? (botMapzen ?? botGoogle)
                : (botGoogle ?? botMapzen);

            if (botGoogle == null && botMapzen == null)
            {
                return("error");
            }

            return(_prefferMapzen
                ? (botMapzen != null ? "mapzen" : "google")
                : (botGoogle != null ? "google" : "mapzen"));
        }
示例#20
0
        public void UpdateBuddyPokemon(BotWindowData targetBot)
        {
            if (targetBot?.Session?.BuddyPokemon == null)
            {
                Dispatcher.Invoke(new ThreadStart(delegate
                {
                    BuddyName.Text = "";
                }));
                return;
            }
            var toReset = targetBot.PokemonList.Where(x => x.Buddy);

            foreach (var p in toReset)
            {
                p.Buddy = false;
            }
            var id        = targetBot.Session?.BuddyPokemon.Id;
            var targetMon = targetBot.PokemonList.FirstOrDefault(x => x.Id == id);

            if (targetMon != null)
            {
                targetMon.Buddy = true;
            }


            var nick = targetBot.Session?.BuddyPokemon?.Nickname;

            if (IsNullOrEmpty(targetBot.Session?.BuddyPokemon?.Nickname))
            {
                nick = targetBot.Session?.Translation.GetPokemonName(targetBot.Session.BuddyPokemon.PokemonId);
            }
            Dispatcher.Invoke(new ThreadStart(delegate
            {
                BuddyName.Text  = nick;
                BuddyImg.Source = targetBot.Session?.BuddyPokemon?.PokemonId.ToSource();
            }));
        }
示例#21
0
 public void SetNewBotAndShow(BotWindowData bot)
 {
     Bot        = bot;
     Visibility = Visibility.Visible;
     RefreshSchedule(bot.GlobalSettings.Schedule.Schedule, bot.GlobalSettings.Schedule.ActionList);
 }
示例#22
0
 internal static void TaskToBanPlayer(BotWindowData bot)
 {
     Task.Run(() => PoGo.PokeMobBot.Logic.Tasks.CrazyTeleporter.Execute(bot.Session));
 }
示例#23
0
 private async void UseLureModuleFromUi(BotWindowData bot, string fortId)
 {
     await UseLureModule.Execute(bot.Session, bot.CancellationToken, fortId);
 }
示例#24
0
 public void SetBot(BotWindowData bot)
 {
     _bot = bot;
     UpdateLists();
 }