Beispiel #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);
        }
Beispiel #2
0
        public static Boolean MineGuildGold()
        {
            OpenObjects.OpenGuild();

            if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_DAILY_COINS, ColorConstants.GUILD_DAILY_COINS))
            {
                MouseHandler.MoveCursor(LocationConstants.GUILD_DAILY_COINS, true);
            }

            if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_MINE_BONUS, ColorConstants.GUILD_MINE_BONUS))
            {
                Main.LogConsole("Claiming Previous Bonus");
                MouseHandler.MoveCursor(LocationConstants.GUILD_CLAIM_BONUS, true);
                Main.Sleep(2);
                MouseHandler.MoveCursor(LocationConstants.GUILD_CLAIM, true);
                MineGuildGold();
            }

            if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_START_DIGGING, ColorConstants.GUILD_START_DIGGING))
            {
                Main.LogConsole("Digging next bonus...");
                Main.Sleep(2);
                MouseHandler.MoveCursor(LocationConstants.GUILD_START_DIGGING, true);
            }

            return(true);
        }
Beispiel #3
0
        public static bool BraveAttackHandler()
        {
            WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME);

            Main.ResetToHome();

            OpenObjects.OpenArena();

            return(AttackBraveLeague());
        }
Beispiel #4
0
        /* Might Be Wondering why i have a seperate function which "Handles" the
         * Attack when i could just add the commands to the main function
         * but the reason is because i can call it to reset / reopen
         * the Attack Object when something goes wrong.
         */

        #region DenOfSecrets Attack
        public static void DenOfSecretAttackHandler()
        {
            WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME);

            Main.ResetToHome();

            OpenObjects.OpenDoS();

            AttackDenOfSecrets();
        }
Beispiel #5
0
        public static void PlanetTrialAttackHandler()
        {
            WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME);

            Main.ResetToHome();

            OpenObjects.OpenPlanetTrial();

            PlanetTrialAttack();
        }
Beispiel #6
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);
        }
Beispiel #7
0
        public static bool ClaimTavernQuest()
        {
            Main.ResetToHome();
            OpenObjects.OpenTavern();
            Thread.Sleep(100);
            MouseHandler.MoveCursor(LocationConstants.CASTLE_SCROLL_LOCATION);
            for (int i = 0; i < 5; i++)
            {
                MouseHandler.MouseWheelDown();
            }

            int howmuch = 0;

            if (FinishQuest())
            {
                howmuch++;
                FinishQuest();
                if (FinishQuest())
                {
                    howmuch++;
                }
            }


            if (howmuch == 2)
            {
                return(true);
            }

            if (CheckSpeedUp())
            {
                //Add Speed Up handling
                howmuch++;
            }

            if (CheckDispatch())
            {
                howmuch++;

                if (CheckDispatch())
                {
                    howmuch++;
                }
            }

            if (howmuch > 2)
            {
                Main.LogConsole("Completed Daily Tavern Quests");
                return(true);
            }

            return(false);
        }
Beispiel #8
0
        public static Boolean SetGuildTeam()
        {
            OpenObjects.OpenGuild();

            if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_WAR_TEAM, ColorConstants.GUILD_SET_WAR))
            {
                Main.Sleep(2);
                MouseHandler.MoveCursor(LocationConstants.GUILD_WAR_TEAM, true);
                Main.Sleep(2);
                MouseHandler.MoveCursor(LocationConstants.GUILD_SET_TEAM, true);
                Main.Sleep(2);
            }
            return(true);
        }
Beispiel #9
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);;
        }
Beispiel #10
0
        public static bool GuildBossAttackHandler()
        {
            OpenObjects.OpenGuild();

            return(GuildBossAttack());
        }
Beispiel #11
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);
        }
Beispiel #12
0
        public static Boolean ClaimEvents()
        {
            WindowCapture.CaptureApplication("Nox");
            Main.LogConsole("Trying to Claim Daily Events");
            Main.ResetToHome();

            Thread.Sleep(500);
            MouseHandler.MoveCursor(LocationConstants.HOME_MAINMENU_LOCATION, true);
            Main.Sleep(1);

            if (!PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_GREEN) && !PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_RED))
            {
                Main.LogConsole("Events Already Claimed!");
                return(true);
            }

            MouseHandler.MoveCursor(LocationConstants.MENU_EVENTS, true);
            bool[] wonAttack    = { false, false, false };
            bool[] attacked     = { false, false, false };
            int    totalClaimed = 0;

            //remove 96 Height

            #region Attack Event
            //Check if an attack is available
            if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_1, ColorConstants.EVENTS_ATTACK_1))
            {
                attacked[0] = true;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_1, true);
                OpenChallenge();
                if (!Attack.EventsAttack())
                {
                    Main.LogConsole("Failed Win Event 1 Challenge!");
                }
                else
                {
                    Main.LogConsole("Successfully Defeated Event 1 Challenge!");
                    totalClaimed++;
                    wonAttack[0] = true;
                }
            }

            if (attacked[0])
            {
                OpenObjects.OpenEvents();
            }

            if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_2, ColorConstants.EVENTS_ATTACK_2))
            {
                attacked[1] = true;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_2, true);
                OpenChallenge();
                if (!Attack.EventsAttack())
                {
                    Main.LogConsole("Failed Win Event 2 Challenge!");
                }
                else
                {
                    Main.LogConsole("Successfully Defeated Event 1 Challenge!");
                    totalClaimed++;
                    wonAttack[1] = true;
                }
            }

            if (attacked[1])
            {
                OpenObjects.OpenEvents();
            }

            if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_3, ColorConstants.EVENTS_ATTACK_3))
            {
                attacked[2] = true;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_3, true);
                OpenChallenge();
                if (!Attack.EventsAttack())
                {
                    Main.LogConsole("Failed Win Event 3 Challenge!");
                }
                else
                {
                    Main.LogConsole("Successfully Defeated Event 1 Challenge!");
                    totalClaimed++;
                    wonAttack[2] = true;
                }
            }
            #endregion

            if (attacked[2])
            {
                OpenObjects.OpenEvents();
            }

            #region Claim Events
            while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_1, ColorConstants.EVENTS_CLAIM_1))
            {
                totalClaimed++;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_1, true);
            }

            while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_2, ColorConstants.EVENTS_CLAIM_2))
            {
                totalClaimed++;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_2, true);
            }

            while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_3, ColorConstants.EVENTS_CLAIM_3))
            {
                totalClaimed++;
                MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_3, true);
            }

            #endregion

            Main.LogConsole($"Claimed {totalClaimed.ToString()} Daily Events");

            Main.ResetToHome();

            return(true);
        }