static public Troop IdentifyTroopKind(int buttonNumber)
        {
            Color troopPixel = CoCHelper.GetPixelColor(DropTroopPixelByPosition(buttonNumber));

            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0xF8B020), 5))
            {
                return(Troop.Barbarian);
            }
            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0xD83F68), 5))
            {
                return(Troop.Archer);
            }
            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0x7BC950), 5))
            {
                return(Troop.Goblin);
            }
            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0xF8D49E), 5))
            {
                return(Troop.Giant);
            }
            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0x60A4D0), 5))
            {
                return(Troop.WallBreaker);
            }
            if (CoCHelper.SameColor(troopPixel, Color.FromArgb(0xF8EB79), 5))
            {
                return(Troop.King);
            }
            if (CoCHelper.IsInColorRange(new ClickablePoint(68 + (72 * buttonNumber), 588), Color.FromArgb(0x7031F0), 5))
            {
                return(Troop.Queen);
            }
            if (CoCHelper.IsInColorRange(new ClickablePoint(68 + (72 * buttonNumber), 585), Color.FromArgb(0x68ACD4), 5))
            {
                return(Troop.CastleClan);
            }
            if (CoCHelper.IsInColorRange(new ClickablePoint(68 + (72 * buttonNumber), 632), Color.FromArgb(0x0426EC), 5))
            {
                return(Troop.SpellLightning);
            }
            return(Troop.None);
        }
예제 #2
0
        public static void ZoomOut()
        {
            Main.Bot.WriteToOutput("Zooming Out");

            int count = 0;

            while (!CoCHelper.SameColor(CoCHelper.GetPixelColor(ScreenData.TopLeftClient), Color.Black))
            {
                if (count >= 15)
                {
                    break;
                }
                else
                {
                    KeyboardHelper.SendVirtualKeyToBS(KeyboardHelper.VirtualKeys.VK_DOWN);
                    Thread.Sleep(300);
                    count++;
                }
            }

            Main.Bot.WriteToOutput("Zoomed Out");
        }