Exemplo n.º 1
0
        public static int[] GetCurrecyDetails()
        {
            Main.ResetToHome();
            Main.Sleep(1);
            OpenObjects.OpenAltar();
            Main.Sleep(2);
            int[] CurrencyArray = new int[5]; // 0 = Gold; 1 = Gem; 2 = Level; 3 = Purple Soul; 4 = Golden Soul;

            //Task/Thread This Later
            CurrencyArray[0] = ImageToText.GetMoneyAmount();
            CurrencyArray[1] = ImageToText.GetGemAmount();
            CurrencyArray[2] = ImageToText.GetLevel();
            CurrencyArray[3] = ImageToText.GetPurpleSoulAmount();
            CurrencyArray[4] = ImageToText.GetGoldenSoulAmount();

            if (CurrencyArray[2] == -1)
            {
                MouseHandler.MoveCursor(TextConstants.LEVEL_START, true);
                CurrencyArray[2] = ImageToText.GetLevelAdvanced();
            }

            Console.WriteLine("Gold " + CurrencyArray[0]);
            Console.WriteLine("Gem " + CurrencyArray[1]);
            Console.WriteLine("Level " + CurrencyArray[2]);
            Console.WriteLine("Purple " + CurrencyArray[3]);
            Console.WriteLine("Golden " + CurrencyArray[4]);

            return(CurrencyArray);
        }
Exemplo n.º 2
0
        public static Boolean SpinWheel()
        {
            OpenObjects.OpenFortuneWheel();
            Thread.Sleep(500);
            int Tokens = ImageToText.GetWheelCoinAmount();

            if (Tokens < 2)
            {
                //Add Purchasing Token Below
                if (GlobalVariables.CURRENCY_INFO[1] < 300 && GlobalVariables.CURRENCY_INFO[1] != -1)
                {
                    Main.LogConsole("Not Enough Tokens & Gem Amount Below 300. Not Purchasing Any Tokens");
                    return(false);
                }
                if (Tokens == 1)
                {
                    //Add Token Purchasing
                    if (GlobalVariables.CURRENCY_INFO[1] < 100)
                    {
                        Main.LogConsole("Gems Below 100. Bot Purchasing Tokens");
                    }
                    else
                    {
                        Main.LogConsole("Gems Above 300. Purchasing 1 Token");
                        PurchaseTokens();
                    }
                    //MouseHandler.MoveCursor()
                    Thread.Sleep(1000);
                }
                else if (Tokens == 0 || Tokens == -1)
                {
                    Main.LogConsole("Gems Above 300. Purchasing 2 Tokens");
                    //Add Token Purchasing
                    PurchaseTokens();
                    Thread.Sleep(1000);
                    PurchaseTokens();
                    Thread.Sleep(1000);
                }
            }

            Main.LogConsole("Got Enough Tokens Spinning Wheel");
            MouseHandler.MoveCursor(LocationConstants.FORTUNE_SPIN1_BUTTON, true);
            Thread.Sleep(7000);
            MouseHandler.MoveCursor(LocationConstants.FORTUNE_SPINAGAIN1_BUTTON, true);
            Thread.Sleep(7000);
            Main.LogConsole("Spun Daily Wheel");



            Main.ResetToHome();

            return(true);
        }
Exemplo n.º 3
0
        public static Boolean SummonCommonKey()
        {
            Main.ResetToHome();
            OpenObjects.OpenHeroChest();

            bool claimedCommon = false;

            //Goes to Bottom Of Hero Chest Screen
            for (int i = 0; i < 10; i++)
            {
                MouseHandler.MoveCursor(LocationConstants.CASTLE_SCROLL_LOCATION, true);
            }

            Main.LogConsole("Checking Daily Common Key");

            if (PixelChecker.CheckPixelValue(LocationConstants.HEROCHEST_COMMON_FREE_CIRCLE, ColorConstants.HEROCHEST_COMMON_FREE))
            {
                Main.LogConsole("Claiming Daily Free Common Summon Key");
                MouseHandler.MoveCursor(LocationConstants.HEROCHEST_COMMON_FREE_CIRCLE, true);
                return(true);
            }

            if (!claimedCommon)
            {
                int CommonKeyNo = ImageToText.GetCommonKeyAmount();
                if (CommonKeyNo > 0)
                {
                    Main.LogConsole("Using Extra Common Summon Key In Backpack. Since No More Free Keys");
                    MouseHandler.MoveCursor(LocationConstants.HEROCHEST_COMMON_CLAIM, true);
                    return(true);
                }
            }

            Main.LogConsole("No Keys Available to Summon Common Chest");

            return(false);;
        }
Exemplo n.º 4
0
        public static void HomeBossAttack(int retryAmount)
        {
            //Reset To Home
            WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME);
            bool lost = false;

            Main.Sleep(3);

            string BossStatus = ImageToText.HomeBoss();

            if (BossStatus == "next")
            {
                MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_BATTLE_NEXT, true);
                Main.Sleep(2);
                Point loc = new Point();
                if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out loc))
                {
                    MouseHandler.MoveCursor(loc, true);
                }
                Main.Sleep(1);
                HomeBossAttack(0); //Starts Idling On Next Stage Then Re-Calls Function to Check for updates status
            }
            else if (BossStatus == "waves")
            {
                Main.LogConsole("Idling main boss...");
                for (int i = 0; i < 250; i++)
                {
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_BOT_IDLE_CLICK, true);
                    Thread.Sleep(200);
                }
                HomeBossAttack(0); //Clicks for 100 hundred times and then rechecks if waves have been defeated
            }
            else if (BossStatus == "battle")
            {
                for (int CurrentTry = 0; CurrentTry < OtherConstants.ATTACK_RETRY_AMOUNT; CurrentTry++)
                {
                    MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_BATTLE_NEXT, true);
                    Main.Sleep(2);
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true);
                    Main.Sleep(2);
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_TEAM_BATTLE_CONFIRM, true);
                    Main.Sleep(3);

                    Main.Sleep(15); //Sleeps for 15 seconds as player is unable to skip in Home Bosses

                    bool BattleWon = CheckWin();

                    if (BattleWon)
                    {
                        Main.LogConsole("Won Home Boss Attack!");
                        Main.Sleep(2);
                        MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true);
                        HomeBossAttack(0);
                        break; //Not Sure if this is needed but ill just add it anyways
                    }
                    else
                    {
                        Main.LogConsole("Lost Home Boss Attack!");
                        Main.Sleep(1);
                        MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true);
                    }

                    Main.LogConsole("Outcome of the Home Boss Battle Won: {0}", BattleWon.ToString());
                }
            }
            else //Sometimes there can be trouble if the Menu shows "waves" in this case we just try again
            {
                Main.LogConsole("Unable To Read...");
                if (PixelChecker.CheckPixelValue(LocationConstants.HOME_BOSS_MAP_CIRCLE, ColorConstants.HOME_BOSS_MAP_CIRCLE))
                {
                    Main.LogConsole("Yeet Skeet Neet Pee");
                    Main.Sleep(2);
                    MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_MAP_CIRCLE, true);
                    if (PixelChecker.SearchPixel(ColorConstants.HOME_NEXT_MAP, out var loc))
                    {
                        MouseHandler.MoveCursor(loc, true);
                        if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out var loc3))
                        {
                            MouseHandler.MoveCursor(loc3, true);
                            HomeBossAttackHandler();
                        }
                    }
                    else
                    {
                        bool found = PixelChecker.SearchPixel(ColorConstants.HOME_NEXT_MAP, out var locs);
                        if (found)
                        {
                            MouseHandler.MoveCursor(loc, true);
                        }
                        MouseHandler.MoveCursor(loc, true);
                        if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out var loc3))
                        {
                            MouseHandler.MoveCursor(loc3, true);
                            HomeBossAttackHandler();
                        }
                    }
                }

                if (retryAmount == 15)
                {
                    Main.LogConsole("Unable to read Boss Status...");
                    return;
                }

                Main.LogConsole("Moving Onto Next Stage..");

                HomeBossAttackHandler(retryAmount++);
            }
        }
Exemplo n.º 5
0
        private static int GetLowestCE()
        {
            string[] EnemyCEString = new string[3];
            int[]    EnemyCE       = new int[3];
            Console.WriteLine("Reading Values");

            //Similar to Main Menu Boss where it doesn't matter if you win or lose it just attacks the lowest number
            EnemyCEString[0] = ImageToText.GetOcrResponse(TextConstants.BRAVE_ENEMY_CE_1, TextConstants.BRAVE_ENEMY_CE_SIZE);
            Thread.Sleep(1000);
            EnemyCEString[1] = ImageToText.GetOcrResponse(TextConstants.BRAVE_ENEMY_CE_2, TextConstants.BRAVE_ENEMY_CE_SIZE);
            Thread.Sleep(1000);
            EnemyCEString[2] = ImageToText.GetOcrResponse(TextConstants.BRAVE_ENEMY_CE_3, TextConstants.BRAVE_ENEMY_CE_SIZE);

            Console.WriteLine("Yeea");

            try
            {
                EnemyCE[0] = Convert.ToInt32(ImageToText.RemoveWhiteSpace(EnemyCEString[0], true));
            }
            catch (Exception)
            {
                EnemyCE[0] = 999999999;
            }

            try
            {
                EnemyCE[1] = Convert.ToInt32(ImageToText.RemoveWhiteSpace(EnemyCEString[1], true));
            }
            catch (Exception)
            {
                EnemyCE[1] = 999999999;
            }

            try
            {
                EnemyCE[2] = Convert.ToInt32(ImageToText.RemoveWhiteSpace(EnemyCEString[2], true));
            }
            catch (Exception)
            {
                EnemyCE[2] = 999999999;
            }



            Console.WriteLine(EnemyCE[0]);

            int position = -1;

            int[] CEbuffer = new int[3];
            Array.Copy(EnemyCE, CEbuffer, 3);
            Array.Sort(CEbuffer);


            Console.WriteLine($"{EnemyCE[0]} - {EnemyCE[1]} - {EnemyCE[2]}");
            Console.WriteLine(CEbuffer[0]);

            Console.WriteLine(GlobalVariables.attackSettings.BraveMaxCE.ToString());

            if (GlobalVariables.attackSettings.BraveMaxCE > CEbuffer[0])
            {
                if (EnemyCE[0] > EnemyCE[1])
                {
                    if (EnemyCE[0] > EnemyCE[2])
                    {
                        position = 0;
                    }
                    else
                    {
                        position = 2;
                    }
                }
                else if (EnemyCE[1] > EnemyCE[2])
                {
                    if (EnemyCE[1] > EnemyCE[0])
                    {
                        position = 1;
                    }
                    else
                    {
                        position = 0;
                    }
                }
                else if (EnemyCE[2] > EnemyCE[0])
                {
                    if (EnemyCE[2] > EnemyCE[1])
                    {
                        position = 2;
                    }
                    else
                    {
                        position = 1;
                    }
                }
            }

            return(position);
        }
Exemplo n.º 6
0
        public static void PlanetTrialAttack()
        {
            bool AttackingPillar = true;

            while (AttackingPillar)
            {
                for (int CurrentTry = 0; CurrentTry < GlobalVariables.attackSettings.PlanetTrialRetryAmount; CurrentTry++)
                {
                    Main.Sleep(5);

                    var Location = new Point(0, 0);

                    if (!PixelChecker.SearchPixel(ColorConstants.SKYPILLAR_BATTLE_COLOR, out Location))
                    {
                        string BattleTest = ImageToText.GymBattleCheck(out Location);
                        if (BattleTest != "battle")
                        {
                            PlanetTrialAttackHandler();
                        }

                        Main.Sleep(1);

                        MouseHandler.MoveCursor(Location, true);
                    }
                    else
                    {
                        MouseHandler.MoveCursor(Location, true);
                    }

                    Main.Sleep(3);
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true);
                    Main.Sleep(3);
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_TEAM_BATTLE_CONFIRM, true);
                    Main.Sleep(3);

                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_SKIP, true);
                    Main.Sleep(1);
                    MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_SKIP_CONFIRM, true);
                    bool BattleFinished = false;

                    while (!BattleFinished)
                    {
                        //Sleep for 2 seconds and then Check
                        Main.Sleep(2);

                        if (PixelChecker.CheckPixelValue(LocationConstants.GLOBAL_BATTLE_FINISHED, ColorConstants.GLOBAL_BATTLE_FINISHED))
                        {
                            BattleFinished = true;
                        }
                    }

                    bool BattleWon = CheckWin();

                    if (BattleWon)
                    {
                        Main.Sleep(1);
                        MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true);
                        break;
                    }
                    else
                    {
                        Main.Sleep(1);
                        MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true);
                        if (CurrentTry == 2)
                        {
                            AttackingPillar = false;
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        public static Boolean CombineEquipment()
        {
            /*   0   1   2   3   4
             * 0  D | D | D | D | D
             * 1  D | D | D | D | D
             * 2  D | X | X | X | N
             */

            /* START AT (115, 535)
             * WHEN MOVING TO THE RIGHT DO (115 + (POS * 95), 535)
             * WHEN MOVING DOWN DO (115, 535 + (POS * 85))
             * THIS SHOULD LEAVE U TO THE LAST Y =  705
             * SO IN TOTAL THE CALCULATION IS
             * (115 + (POS * 95), 535 + (POS * 85))
             */

            ColorConstants.SetColours();

            Main.ResetToHome();
            OpenObjects.OpenBlackSmith();



            Point startPos = LocationConstants.BLACKSMITH_DEFAULT;
            Point setPos   = startPos;

            int combined = 0;

            Thread.Sleep(1000);

            for (int type = 0; type < 3; type++)
            {
                if (type == 1)
                {
                    MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_ARMOR, true);
                }
                else if (type == 2)
                {
                    MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_ACCESSORY, true);
                }
                else if (type == 3)
                {
                    MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_HELMET, true);
                }


                for (int y = 0; y < 4; y++)
                {
                    for (int x = 0; x < 5; x++)
                    {
                        if (combined >= 3)
                        {
                            return(true);
                        }
                        setPos = new Point(115 + (x * 95), 535 + (y * 85));
                        try
                        {
                            if (PixelChecker.CheckPixelValue(setPos, ColorConstants.Equipments[y, x]))
                            {
                                if (setPos.X == 495)
                                {
                                    setPos = new Point(setPos.X - 5, setPos.Y);
                                }

                                Console.WriteLine($"Found Equipment that needs to be combined. Location - {x}:{y}");

                                MouseHandler.MoveCursor(setPos, true);



                                int CombineAmount = ImageToText.GetCombineAmount();

                                if (CombineAmount == -1)
                                {
                                    Console.WriteLine($"Unable To Read Combine Amount. Combining it Once");

                                    LowerCombineAmont(100);
                                    int price = ImageToText.GetBlacksmithPurchaseAmount();

                                    MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_PURCHASE, true);

                                    Thread.Sleep(3000);

                                    if (PixelChecker.CheckPixelValue(LocationConstants.BLACKSMITH_CLAIM, ColorConstants.BLACKSMITH_CLAIM_COLOR))
                                    {
                                        MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_CLAIM, true);
                                        combined++;
                                    }
                                    else
                                    {
                                        Console.WriteLine("Insufficient Gold!");
                                    }
                                }
                                else
                                {
                                    int loweramount = CombineAmount - 3;
                                    LowerCombineAmont(loweramount);
                                    int price = ImageToText.GetBlacksmithPurchaseAmount();

                                    MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_PURCHASE, true);

                                    Thread.Sleep(3000);

                                    if (PixelChecker.CheckPixelValue(LocationConstants.BLACKSMITH_CLAIM, ColorConstants.BLACKSMITH_CLAIM_COLOR))
                                    {
                                        MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_CLAIM, true);
                                        combined += 3;
                                    }
                                    else
                                    {
                                        Console.WriteLine("Insufficient Gold!");
                                    }
                                }
                            }
                        }
                        catch
                        {
                            x++;
                        }
                    }
                }
            }


            Console.WriteLine("Finished");

            return(true);
        }