Example #1
0
        void btnInstall_Click(object sender, EventArgs e)
        {
            if (timerSnipe.Enabled)
            {
                try {
                    UnregisterUriScheme(URI_SCHEME);
                    UnregisterUriScheme(URI_SCHEME_MSNIPER);

                    Logger.ColoredConsoleWrite(ConsoleColor.DarkYellow, "Service Uninstalled");
                    timerSnipe.Enabled = false;
                } catch (Exception) {
                    MessageBox.Show(th.TS("Cannot uninstall service.") + "\n" + e.ToString());
                }
            }
            else
            {
                try {
                    RegisterUriScheme(Application.ExecutablePath, URI_SCHEME, URI_KEY);
                    RegisterUriScheme(Application.ExecutablePath, URI_SCHEME_MSNIPER, URI_KEY_MSNIPER);
                    Logger.ColoredConsoleWrite(ConsoleColor.DarkYellow, "Service Installed");
                    timerSnipe.Enabled = true;
                } catch (Exception) {
                    MessageBox.Show(th.TS("Cannot install service.") + "\n" + e.ToString());
                }
            }
        }
Example #2
0
        public void RefreshTitle()
        {
            var txt = th.TS("Eggs");

            if (Parent != null)
            {
                txt += ": " + listView.Items.Count;
            }
            Parent.Text = txt;
        }
Example #3
0
        public void Init(bool asViewOnly, int team = 0, int level = 0, long exp = 0)
        {
            map.Manager.Mode = AccessMode.ServerOnly;

            buttonRefreshForts.Visible = false;
            this.asViewOnly            = asViewOnly;
            panel1.Size = new Size(700, 47);
            if (asViewOnly)
            {
                panel1.Size = new Size(483, 71);
                initViewOnly(team, level, exp);
            }
            else
            {
                radiusOverlay = new GMapOverlay();
                map.Overlays.Add(radiusOverlay);
                nudRadius.Value         = GlobalVars.radius;
                btnPauseWalking.Visible = false;
                if (GlobalVars.SaveForts)
                {
                    LoadPokestopsInfo();
                }
            }
            buttonZoomOut.Visible       = true;
            buttonZoomIn.Visible        = true;
            buttonSavePokestops.Visible = true;
            buttonLoadPokestops.Visible = true;
            btnPauseWalking.Text        = GlobalVars.pauseAtPokeStop? th.TS("Resume Walking"): th.TS("Pause Walking");
        }
Example #4
0
        void IntializeCombos()
        {
            LoadLinks();

            comboBoxLinks.DataSource    = links;
            comboBoxLinks.DisplayMember = "Text";
            comboBoxLinks.SelectedIndex = 0;

            var pokemonControlSource = new List <PokemonId>();

            checkedListBox_ToSnipe.Items.Clear();
            foreach (PokemonId pokemon in Enum.GetValues(typeof(PokemonId)))
            {
                if (pokemon == PokemonId.Missingno)
                {
                    continue;
                }
                pokemonControlSource.Add(pokemon);
                checkedListBox_ToSnipe.Items.Add(th.TS(pokemon.ToString()));
            }
            comboBox1.DataSource = pokemonControlSource;
        }
Example #5
0
 void infoObservable_HandleNewPokemonLocation(MapPokemon mapPokemon)
 {
     Invoke(new MethodInvoker(() => {
         if (!_pokemonMarks.ContainsKey(mapPokemon.SpawnPointId))
         {
             GMarkerGoogle pokemonMarker;
             Bitmap pokebitMap = PokeImgManager.GetPokemonMediumImage(mapPokemon.PokemonId);
             if (pokebitMap != null)
             {
                 var ImageSize = new System.Drawing.Size(pokebitMap.Width, pokebitMap.Height);
                 pokemonMarker = new GMarkerGoogle(new PointLatLng(mapPokemon.Latitude, mapPokemon.Longitude), pokebitMap)
                 {
                     Offset = new System.Drawing.Point(-ImageSize.Width / 2, -ImageSize.Height / 2)
                 };
             }
             else
             {
                 pokemonMarker = new GMarkerGoogle(new PointLatLng(mapPokemon.Latitude, mapPokemon.Longitude), GMarkerGoogleType.green_small);
             }
             var expriationTime = StringUtils.TimeMStoString(mapPokemon.ExpirationTimestampMs, @"mm\:ss");
             Logger.Debug("Expires in: " + expriationTime);
             var address = LocationUtils.FindAddress(mapPokemon.Latitude, mapPokemon.Longitude);
             pokemonMarker.ToolTipText = th.TS("{0}\nExpires in: {1}\n{2}\n{3},{4}", new object[] {
                 mapPokemon.PokemonId,
                 expriationTime,
                 address,
                 mapPokemon.Latitude,
                 mapPokemon.Longitude
             });
             pokemonMarker.ToolTip.Font = new Font("Arial", 12, GraphicsUnit.Pixel);
             pokemonMarker.ToolTipMode  = MarkerTooltipMode.OnMouseOver;
             _pokemonMarks.Add(mapPokemon.SpawnPointId, pokemonMarker);
             _pokemonOverlay.Markers.Add(pokemonMarker);
         }
     }));
 }
Example #6
0
        public void Execute()
        {
            try {
                var client = Logic.Logic.objClient;
                if (client.ReadyToUse != false)
                {
                    var items      = client.Inventory.GetEggs();
                    var incubators = client.Inventory.GetEggIncubators();
                    var arrStats   = client.Inventory.GetPlayerStats();
                    var stats      = arrStats.First();

                    listView.Items.Clear();

                    ListViewItem listViewItem;
                    foreach (var item in items)
                    {
                        listViewItem          = new ListViewItem();
                        listViewItem.Tag      = item;
                        listViewItem.Text     = "" + item.EggKmWalkedStart;
                        listViewItem.ImageKey = "" + (item.EggKmWalkedTarget - item.EggKmWalkedStart) + "km";

                        EggIncubator incubator = GetIncubator(incubators, item.EggIncubatorId);
                        if (incubator != null)
                        {
                            if (incubator.ItemId == ItemId.ItemIncubatorBasic)
                            {
                                listViewItem.ImageKey = "bincegg";
                            }
                            else if (incubator.ItemId == ItemId.ItemIncubatorBasicUnlimited)
                            {
                                listViewItem.ImageKey = "unincegg";
                            }
                            listViewItem.Text = "" + Math.Round(incubator.TargetKmWalked - stats.KmWalked, 2);
                        }
                        listViewItem.SubItems.Add("" + item.EggKmWalkedTarget);
                        if (incubator != null)
                        {
                            listViewItem.SubItems.Add("" + incubator.PokemonId.ToString("X"));
                        }
                        else
                        {
                            listViewItem.SubItems.Add(th.TS(item.PokemonId.ToString()));
                        }
                        listViewItem.SubItems.Add(string.Format("{0}% {1}-{2}-{3}", PokemonGo.RocketAPI.PokemonInfo.CalculatePokemonPerfection(item).ToString("0"), item.IndividualAttack, item.IndividualDefense, item.IndividualStamina));
                        listViewItem.SubItems.Add(GetCreationTime(item.CreationTimeMs));
                        listViewItem.SubItems.Add(string.Format("{0}", item.Move1));
                        listViewItem.SubItems.Add(string.Format("{0} ({1})", item.Move2, PokemonGo.RocketAPI.PokemonInfo.GetAttack(item.Move2)));
                        if (incubator != null)
                        {
                            listViewItem.SubItems.Add(string.Format("Uses:{0}", incubator.UsesRemaining));
                        }
                        listView.Items.Add(listViewItem);
                    }
                    listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                    RefreshTitle();
                }
            } catch (Exception e) {
                Logger.Error("[EggsList-Error] " + e.StackTrace);
                RandomHelper.RandomSleep(1000, 1100);
                //Execute();
            }
        }
Example #7
0
 private void InitializeData()
 {
     this.listView.Items.AddRange(new [] {
         new ListViewItem(new string[] { "1", th.TS("Username"), "" }),
         new ListViewItem(new string[] { "2", th.TS("Coins"), "" }),
         new ListViewItem(new string[] { "3", th.TS("Stardust"), "" }),
         new ListViewItem(new string[] { "4", th.TS("Max Items"), "" }),
         new ListViewItem(new string[] { "5", th.TS("Max Pokemons"), "" }),
         new ListViewItem(new string[] { "6", th.TS("Battle Lockout End (Ms)"), "" }),
         new ListViewItem(new string[] { "7", th.TS("Level"), "" }),
         new ListViewItem(new string[] { "8", th.TS("Pokedex"), "" }),
         new ListViewItem(new string[] { "9", th.TS("Kms Walked"), "" }),
         new ListViewItem(new string[] { "10", th.TS("Eggs Hatched"), "" }),
         new ListViewItem(new string[] { "11", th.TS("Evolutions"), "" }),
         new ListViewItem(new string[] { "12", th.TS("PokeStop Visits"), "" }),
         new ListViewItem(new string[] { "13", th.TS("Pokeballs Thrown"), "" }),
         new ListViewItem(new string[] { "14", th.TS("Battle Attack"), "" }),
         new ListViewItem(new string[] { "15", th.TS("Battle Defended"), "" }),
         new ListViewItem(new string[] { "16", th.TS("Battle Training"), "" }),
         new ListViewItem(new string[] { "17", th.TS("Pokemon Deployed"), "" }),
         new ListViewItem(new string[] { "18", th.TS("Pokemons Captured"), "" }),
         new ListViewItem(new string[] { "19", th.TS("Pokemons Encountered"), "" }),
         new ListViewItem(new string[] { "20", th.TS("Prestige Dropped"), "" }),
         new ListViewItem(new string[] { "21", th.TS("Prestige Raised"), "" }),
         new ListViewItem(new string[] { "22", th.TS("Small Rattata Caught"), "" }),
         new ListViewItem(new string[] { "23", th.TS("Big Magikarp Caught"), "" }),
         new ListViewItem(new string[] { "24", th.TS("Used Km Pool"), "" })
     });
 }
Example #8
0
        public ChangesPanel()
        {
            InitializeComponent();
            comboLanguage.SelectedIndex = 0;
            switch (th.GetSelectedLanguage())
            {
            case "default":
                comboLanguage.SelectedIndex = 1;
                break;

            case "de":
                comboLanguage.SelectedIndex = 2;
                break;

            case "es":
                comboLanguage.SelectedIndex = 3;
                break;

            case "ca":
                comboLanguage.SelectedIndex = 4;
                break;

            case "zh":
                comboLanguage.SelectedIndex = 5;
                break;
            }
            th.Translate(this);

            comboBoxLeaveInGyms.DataSource = new[] {
                th.TS("Random"),
                th.TS("Best CP"),
                th.TS("Worse CP"),
                th.TS("Favourite")
            };
            comboBoxLeaveInGyms.SelectedIndex = 0;
            comboBoxAttackers.DataSource      = new[] {
                th.TS("Random"),
                th.TS("Best CP"),
                th.TS("Favourites"),
                th.TS("Lower than defenders CP"),
                th.TS("Best HP")
            };
            comboBoxAttackers.SelectedIndex = 0;
        }
Example #9
0
        private void InitialzePokemonListView()
        {
            PokemonListView.Columns.Clear();
            ColumnHeader columnheader;

            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Name");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);

            PokemonListView.Columns.Add(CreateColumn(th.TS("Slash")));

            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("CP");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);

            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("IV A-D-S");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("LVL");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Evolvable?");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Height");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Weight");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("HP");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Attack");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("SpecialAttack (DPS)");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = "#";
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("% CP");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Type");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);
            columnheader      = new ColumnHeader();
            columnheader.Name = th.TS("Type 2");
            columnheader.Text = columnheader.Name;
            PokemonListView.Columns.Add(columnheader);

            PokemonListView.Columns.Add(CreateColumn(th.TS("Catch Date")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Pokeball")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Num Upgrades")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Battles Attacked")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Battles Defended")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("In Gym")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Capture Place")));

            PokemonListView.Columns.Add(CreateColumn(th.TS("Gender")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Costume")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Form")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Shiny")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Buddy Candy Awarded")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("Buddy Total Km Walked")));
            PokemonListView.Columns.Add(CreateColumn(th.TS("ID")));

            PokemonListView.Columns["#"].DisplayIndex = 0;
            PokemonListView.ColumnClick += PokemonListView_ColumnClick;

            PokemonListView.ShowItemToolTips = true;
            PokemonListView.DoubleBuffered(true);
            PokemonListView.View = View.Details;
            createImageList();
        }
Example #10
0
        public ItemsPanel()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            th.Translate(this);

            this.chID.Text     = th.TS("#");
            this.chItem.Text   = th.TS("Item");
            this.chCount.Text  = th.TS("Count");
            this.chUnseen.Text = th.TS("Unseen");
        }