Ejemplo n.º 1
0
        public static int getMyPokemonsIV(int slot, int idIv)
        {
            switch (idIv)
            {
            case AppConstants.IV_HP:
                return(MemoryHandler.readByte(address_iv_hp[slot])[0]);

            case AppConstants.IV_ATTACK:
                return(MemoryHandler.readByte(address_iv_attack[slot])[0]);

            case AppConstants.IV_DEFENCE:
                return(MemoryHandler.readByte(address_iv_defensa[slot])[0]);

            case AppConstants.IV_SPATTACK:
                return(MemoryHandler.readByte(address_iv_spAttack[slot])[0]);

            case AppConstants.IV_SPDEFENCE:
                return(MemoryHandler.readByte(address_iv_spDefensa[slot])[0]);

            case AppConstants.IV_SPEED:
                return(MemoryHandler.readByte(address_iv_speed[slot])[0]);
            }

            return(-1);
        }
Ejemplo n.º 2
0
        public static void bringPokemonOnTop()
        {
            Process p = MemoryHandler.getPokemonProcess();

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

            Process p = MemoryHandler.getPokemonProcess();

            if (p != null)
            {
                SetForegroundWindow(p.MainWindowHandle);
            }
        }
Ejemplo n.º 4
0
        public static void writeByte(int dir, byte value)
        {
            Process process = getPokemonProcess();

            if (process == null)
            {
                return;
            }

            int bytesEscritos;

            MemoryHandler.WriteMemory(process, dir, value, out bytesEscritos);
        }
Ejemplo n.º 5
0
        public static byte[] readByte(int dir)
        {
            Process process = getPokemonProcess();

            if (process == null)
            {
                return(null);
            }

            int salida;

            byte[] value = MemoryHandler.ReadMemory(process, dir, sizeof(int), out salida);
            return(value);
        }
Ejemplo n.º 6
0
        public static float readFloat(int dir)
        {
            Process process = getPokemonProcess();

            if (process == null)
            {
                return(0);
            }

            int salida;

            byte[] value = MemoryHandler.ReadMemory(process, dir, sizeof(float), out salida);
            return(BitConverter.ToSingle(value, 0));
        }
Ejemplo n.º 7
0
        public static short readShort(int dir)
        {
            Process process = getPokemonProcess();

            if (process == null)
            {
                return(0);
            }

            int salida;

            byte[] value = MemoryHandler.ReadMemory(process, dir, sizeof(short), out salida);

            return(BitConverter.ToInt16(value, 0));
        }
Ejemplo n.º 8
0
        public static void setOption(int final)
        {
            int actual = GameMenu.getSelectedOption();

            while (final != actual && AppConstants.MENU_WAITING != MemoryHandler.getActualMenu())
            {
                actual = GameMenu.getSelectedOption();

                /* Mover derecha */
                if ((final == AppConstants.MENU_OPTION_2 || final == AppConstants.MENU_OPTION_4) &&
                    (actual == AppConstants.MENU_OPTION_1 || actual == AppConstants.MENU_OPTION_3))
                {
                    moveRight();
                    continue;
                }

                /* Mover izquierda */
                if ((final == AppConstants.MENU_OPTION_1 || final == AppConstants.MENU_OPTION_3) &&
                    (actual == AppConstants.MENU_OPTION_2 || actual == AppConstants.MENU_OPTION_4))
                {
                    moveLeft();
                    continue;
                }

                /* Mover abajo */
                if ((final == AppConstants.MENU_OPTION_3 || final == AppConstants.MENU_OPTION_4) &&
                    (actual == AppConstants.MENU_OPTION_1 || actual == AppConstants.MENU_OPTION_2))
                {
                    moveDown();
                    continue;
                }

                /* Mover arriba */
                if ((final == AppConstants.MENU_OPTION_1 || final == AppConstants.MENU_OPTION_2) &&
                    (actual == AppConstants.MENU_OPTION_3 || actual == AppConstants.MENU_OPTION_4))
                {
                    moveUp();
                    continue;
                }
            }
        }
Ejemplo n.º 9
0
        private void timer_walk_Tick(object sender, EventArgs e)
        {
            if (!checkBox_cavebot.Checked)
            {
                return;
            }
            try
            {
                /* Por nivel */
                if (Player.getPokemonLvl(AppConstants.SLOT_1) >= Convert.ToInt32(textBox1.Text))
                {
                    return;
                }

                /* Por exp */
                //if (Player.getPokemonCurrentExp(AppConstants.SLOT_1) >= Convert.ToInt32(textBox1.Text)) return;
            }
            catch (Exception ex) { }

            //label1.Text = "Ahora: " + waypointList[nextWaypoint].getWaypoint();
            /* Marcamos el actual en la lista */
            //listView_waypoints.Items[nextWaypoint].Text = ">>>" + listView_waypoints.Items[nextWaypoint].Text;
            listView_waypoints.Items[nextWaypoint].ForeColor = Color.FromKnownColor(KnownColor.Red);
            /* Borramos el texto de todos los otros */
            for (int i = 0; i < listView_waypoints.Items.Count; i++)
            {
                if (i != nextWaypoint)
                {
                    //listView_waypoints.Items[i].Text = listView_waypoints.Items[i].Text.Replace(">>>", "");
                    listView_waypoints.Items[i].ForeColor = Color.FromKnownColor(KnownColor.Black);
                }
            }

            if (!isWalking && !MemoryHandler.estaPeleando())
            {
                Thread t = new Thread(goToNextWaypoint);
                t.Start();
            }
        }
Ejemplo n.º 10
0
        public void goToNextWaypoint()
        {
            if (waypointList.Count == 0)
            {
                return;
            }

            isWalking = true;
            int nextWaypointType = waypointList[nextWaypoint].getType();

            if (nextWaypointType == AppConstants.WAYPOINT_ACTION)
            {
                //int yInicial = Player.getPosY();
                //int yFinal = yInicial++; // Cuando haya bajado 1 sqm es pq termino de hablar

                while (MemoryHandler.getPosY() < 5) /* que balurdez */
                {
                    BotUtils.doAction();
                    Thread.Sleep(AppConstants.LAG_HIGH);
                    BotUtils.moveDown();
                    Thread.Sleep(AppConstants.LAG_HIGH);
                }
            }
            else
            {
                BotUtils.walk(waypointList[nextWaypoint]);

                /*BotUtils.moveRight();
                 * Thread.Sleep(AppConstants.KEY_DELAY);
                 * BotUtils.moveLeft();*/
                Thread.Sleep(AppConstants.KEY_DELAY);
            }

            int prevType = nextWaypointType;

            if ((Player.getPosX() == waypointList[nextWaypoint].getX() &&
                 Player.getPosY() == waypointList[nextWaypoint].getY()) ||
                nextWaypointType == AppConstants.WAYPOINT_ACTION ||
                nextWaypointType == AppConstants.WAYPOINT_DOOR)
            {
                nextWaypoint = getNextWaypointId();
            }

            /* Chequeo si era LOOP o ENDLOOP para modificar ...*/
            if (prevType == AppConstants.WAYPOINT_LOOP)
            {
                /* Chequeo PPs.. Si tengo, sigo normal.. Sino, mando al sig de endloop */
                if (!BotUtils.tengoPP(AppConstants.FIGHT_PP1, AppConstants.FIGHT_PP2,
                                      AppConstants.FIGHT_PP3, AppConstants.FIGHT_PP4))
                {
                    /* Busco el que sigue despues de endloop */
                    for (int i = prevType; i < waypointList.Count; i++)
                    {
                        if (waypointList[i].getType() == AppConstants.WAYPOINT_ENDLOOP)
                        {
                            nextWaypoint = i + 1;
                            break;
                        }
                    }
                }
            }
            if (prevType == AppConstants.WAYPOINT_ENDLOOP)
            {
                /* Mando a LOOP */
                for (int i = 0; i < waypointList.Count; i++)
                {
                    if (waypointList[i].getType() == AppConstants.WAYPOINT_LOOP)
                    {
                        nextWaypoint = i;
                        break;
                    }
                }
            }

            isWalking = false;
        }
Ejemplo n.º 11
0
 public static int getPokemonCurrentExp(int slot)
 {
     return(MemoryHandler.getPokemonCurrentExp(slot));
 }
Ejemplo n.º 12
0
 public static short getPokemonId(int slot)
 {
     return(MemoryHandler.getPokemonId(slot));
 }
Ejemplo n.º 13
0
 public static int getPokemonLvl(int slot)
 {
     return(MemoryHandler.getPokemonLvl(slot));
 }
Ejemplo n.º 14
0
 public static short getPP(int slot, int ppId)
 {
     return(MemoryHandler.getPP(slot, ppId));
 }
Ejemplo n.º 15
0
 public static int getMoney()
 {
     return(MemoryHandler.getMoney());
 }
Ejemplo n.º 16
0
 public static int getActualMenu()
 {
     return(MemoryHandler.getActualMenu());
 }
Ejemplo n.º 17
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
            }
        }
Ejemplo n.º 18
0
 public static short getPP(int slot, int ppId)
 {
     return(MemoryHandler.readByte(addressesPPS[slot][ppId])[0]);
 }
Ejemplo n.º 19
0
        public BotForm()
        {
            InitializeComponent();

            this.Text = BotForm.NAME + " " + BotForm.VERSION;

            changeLog.Visible = false;
            targeting.Visible = false;
            cavebot.Visible   = false;

            #region Creamos listas de todo lo que se repite pa despues sea mas facil modificarlo
            labelsSlotsNombres.Add(label_slot1);
            labelsSlotsNombres.Add(label_slot2);
            labelsSlotsNombres.Add(label_slot3);
            labelsSlotsNombres.Add(label_slot4);
            labelsSlotsNombres.Add(label_slot5);
            labelsSlotsNombres.Add(label_slot6);

            labelsSlotsLvl.Add(label_slot1LVL);
            labelsSlotsLvl.Add(label_slot2LVL);
            labelsSlotsLvl.Add(label_slot3LVL);
            labelsSlotsLvl.Add(label_slot4LVL);
            labelsSlotsLvl.Add(label_slot5LVL);
            labelsSlotsLvl.Add(label_slot6LVL);

            labelsSlotsExpTotal.Add(label_slot1ExpTotal);
            labelsSlotsExpTotal.Add(label_slot2ExpTotal);
            labelsSlotsExpTotal.Add(label_slot3ExpTotal);
            labelsSlotsExpTotal.Add(label_slot4ExpTotal);
            labelsSlotsExpTotal.Add(label_slot5ExpTotal);
            labelsSlotsExpTotal.Add(label_slot6ExpTotal);

            labelsSlotsHp.Add(label_slot1HP);
            labelsSlotsHp.Add(label_slot2HP);
            labelsSlotsHp.Add(label_slot3HP);
            labelsSlotsHp.Add(label_slot4HP);
            labelsSlotsHp.Add(label_slot5HP);
            labelsSlotsHp.Add(label_slot6HP);

            labelsSlotsPP1.Add(label_slot1PP1);
            labelsSlotsPP1.Add(label_slot2PP1);
            labelsSlotsPP1.Add(label_slot3PP1);
            labelsSlotsPP1.Add(label_slot4PP1);
            labelsSlotsPP1.Add(label_slot5PP1);
            labelsSlotsPP1.Add(label_slot6PP1);

            labelsSlotsPP2.Add(label_slot1PP2);
            labelsSlotsPP2.Add(label_slot2PP2);
            labelsSlotsPP2.Add(label_slot3PP2);
            labelsSlotsPP2.Add(label_slot4PP2);
            labelsSlotsPP2.Add(label_slot5PP2);
            labelsSlotsPP2.Add(label_slot6PP2);

            labelsSlotsPP3.Add(label_slot1PP3);
            labelsSlotsPP3.Add(label_slot2PP3);
            labelsSlotsPP3.Add(label_slot3PP3);
            labelsSlotsPP3.Add(label_slot4PP3);
            labelsSlotsPP3.Add(label_slot5PP3);
            labelsSlotsPP3.Add(label_slot6PP3);

            labelsSlotsPP4.Add(label_slot1PP4);
            labelsSlotsPP4.Add(label_slot2PP4);
            labelsSlotsPP4.Add(label_slot3PP4);
            labelsSlotsPP4.Add(label_slot4PP4);
            labelsSlotsPP4.Add(label_slot5PP4);
            labelsSlotsPP4.Add(label_slot6PP4);

            panelsSlots.Add(panel_slot1);
            panelsSlots.Add(panel_slot2);
            panelsSlots.Add(panel_slot3);
            panelsSlots.Add(panel_slot4);
            panelsSlots.Add(panel_slot5);
            panelsSlots.Add(panel_slot6);

            MemoryHandler.loadAddresses();

            #endregion

            PokemonInfo.loadAllPokemons();
            BotUtils.initializeInput();
        }
Ejemplo n.º 20
0
 public static int getPosY()
 {
     return(MemoryHandler.getPosY());
 }
Ejemplo n.º 21
0
 public static bool estaPeleando()
 {
     return(MemoryHandler.estaPeleando());
 }
Ejemplo n.º 22
0
 public static int getHp()
 {
     return(MemoryHandler.getEnemyHp());
 }
Ejemplo n.º 23
0
 public static short getSelectedOption()
 {
     return(MemoryHandler.getSelectedMenuOption());
 }