public static void bringPokemonOnTop()
        {
            Process p = MemoryHandler.getPokemonProcess();

            if (p != null)
            {
                SetForegroundWindow(p.MainWindowHandle);
            }
        }
        public void sendKey(Interceptor.Keys key)
        {
            input.SendKeys(Interceptor.Keys.Enter);
            return;

            Process p = MemoryHandler.getPokemonProcess();

            if (p != null)
            {
                SetForegroundWindow(p.MainWindowHandle);
            }
        }
Exemple #3
0
        private void timer_LeerValores_Tick(object sender, EventArgs e)
        {
            #region Arreglamos los string de lag
            if (AppConstants.KEY_DELAY == AppConstants.LAG_LOW)
            {
                if (!pocoToolStripMenuItem.Text.Contains(AppConstants.LAG_IDENTIFICADOR))
                {
                    pocoToolStripMenuItem.Text = AppConstants.LAG_IDENTIFICADOR + pocoToolStripMenuItem.Text;
                }
            }
            else
            {
                pocoToolStripMenuItem.Text = pocoToolStripMenuItem.Text.Replace(AppConstants.LAG_IDENTIFICADOR, "");
            }

            if (AppConstants.KEY_DELAY == AppConstants.LAG_MEDIUM)
            {
                if (!medioToolStripMenuItem.Text.Contains(AppConstants.LAG_IDENTIFICADOR))
                {
                    medioToolStripMenuItem.Text = AppConstants.LAG_IDENTIFICADOR + medioToolStripMenuItem.Text;
                }
            }
            else
            {
                medioToolStripMenuItem.Text = medioToolStripMenuItem.Text.Replace(AppConstants.LAG_IDENTIFICADOR, "");
            }

            if (AppConstants.KEY_DELAY == AppConstants.LAG_HIGH)
            {
                if (!altoToolStripMenuItem.Text.Contains(AppConstants.LAG_IDENTIFICADOR))
                {
                    altoToolStripMenuItem.Text = AppConstants.LAG_IDENTIFICADOR + altoToolStripMenuItem.Text;
                }
            }
            else
            {
                altoToolStripMenuItem.Text = altoToolStripMenuItem.Text.Replace(AppConstants.LAG_IDENTIFICADOR, "");
            }
            #endregion

            Process proc = MemoryHandler.getPokemonProcess();

            if (proc != null)
            {
                // Posicion
                label_position.Text = "Pos: (" + Player.getPosX().ToString() + ", " + Player.getPosY().ToString() + ")";
                label_money.Text    = Player.getMoney().ToString() + " $";

                // Pelea
                label_hpContrario.Text = "HP: " + Enemy.getHp().ToString();

                short idContrario = Enemy.getId();
                if (idContrario < 0)
                {
                    idContrario = (short)AppConstants.NO_VALUE;
                }

                string shiny = "";
                if (Enemy.isShiny())
                {
                    shiny = "[SHINY] ";
                }
                label_nombrePokemonContrario.Text = shiny + PokemonInfo.getPokemonName(idContrario);
                label_idContrario.Text            = "ID: " + idContrario.ToString();

                #region Slots ...
                for (int i = 0; i < AppConstants.NUM_SLOTS; i++)
                {
                    string slotName = PokemonInfo.getPokemonName(Player.getPokemonId(i));
                    labelsSlotsNombres[i].Text = slotName;
                    if (slotName != "No Pokemon")
                    {
                        panelsSlots[i].Visible = true;

                        /*labelsSlotsLvl[i].Visible = true;
                        *  labelsSlotsExpTotal[i].Visible = true;
                        *  labelsSlotsHp[i].Visible = true;
                        *  labelsSlotsPP1[i].Visible = true;
                        *  labelsSlotsPP2[i].Visible = true;
                        *  labelsSlotsPP3[i].Visible = true;
                        *  labelsSlotsPP4[i].Visible = true;*/

                        labelsSlotsLvl[i].Text      = "Lv: " + Player.getPokemonLvl(i).ToString();
                        labelsSlotsExpTotal[i].Text = "Exp: " + Player.getPokemonCurrentExp(i).ToString();
                        labelsSlotsPP1[i].Text      = Player.getPP(i, AppConstants.PP_1).ToString();
                        labelsSlotsPP2[i].Text      = Player.getPP(i, AppConstants.PP_2).ToString();
                        labelsSlotsPP3[i].Text      = Player.getPP(i, AppConstants.PP_3).ToString();
                        labelsSlotsPP4[i].Text      = Player.getPP(i, AppConstants.PP_4).ToString();
                    }
                    else
                    {
                        panelsSlots[i].Visible = false;

                        /*
                         * labelsSlotsLvl[i].Visible = false;
                         * labelsSlotsExpTotal[i].Visible = false;
                         * labelsSlotsHp[i].Visible = false;
                         * labelsSlotsPP1[i].Visible = false;
                         * labelsSlotsPP2[i].Visible = false;
                         * labelsSlotsPP3[i].Visible = false;
                         * labelsSlotsPP4[i].Visible = false;
                         *
                         * labelsSlotsLvl[i].Text = "Lv: -1";
                         * labelsSlotsExpTotal[i].Text = "Exp: -1";
                         * labelsSlotsPP1[i].Text = "-1";
                         * labelsSlotsPP2[i].Text = "-1";
                         * labelsSlotsPP3[i].Text = "-1";
                         * labelsSlotsPP4[i].Text = "-1";
                         */
                    }
                }
                #endregion
            }
        }