public bool IsFirstWeaponActive()
        {
            var image1 = ScreenCapture.CaptureScreenRelatively(82f, 84f, 95.5f, 96, this.FullScreenMode);
            var image2 = ScreenCapture.CaptureScreenRelatively(90f, 92f, 95.5f, 96, this.FullScreenMode);

            return(image1.GetAverageBrightness() > image2.GetAverageBrightness());
        }
Beispiel #2
0
        public bool IsFirstWeaponActive()
        {
            var image1 = ScreenCapture.CaptureScreenRelatively(82f, 84f, 95.5f, 96);
            var image2 = ScreenCapture.CaptureScreenRelatively(90f, 92f, 95.5f, 96);

            //image1.SaveTestImage();
            //image2.SaveTestImage();

            return(image1.GetAverageBrightness() > image2.GetAverageBrightness());
        }
        public WeaponModuleType[] GetModulesState(int weaponNumberOfModules)
        {
            var ret = new WeaponModuleType[weaponNumberOfModules];

            var baseColors = new[]
            {
                CommonColor,
                RareColor,
                Rare2Color,
                EpicColor,
                LegendaryColor
            };

            for (var i = 0; i < weaponNumberOfModules; i++)
            {
                var offsetX = i * 1.46f;
                var image   = ScreenCapture.CaptureScreenRelatively(79.3f + offsetX, 79.5f + offsetX, 92.8f, 93.2f, this.FullScreenMode);
                //image.SaveTestImage(i.ToString());
                var avColor = image.GetAverageColor();

                var closestColor = ImageUtils.GetClosestColor(baseColors, avColor);

                if (closestColor == CommonColor)
                {
                    ret[i] = WeaponModuleType.Common;
                }
                else if (closestColor == RareColor || closestColor == Rare2Color)
                {
                    ret[i] = WeaponModuleType.Rare;
                }
                else if (closestColor == EpicColor)
                {
                    ret[i] = WeaponModuleType.Epic;
                }
                else if (closestColor == LegendaryColor)
                {
                    ret[i] = WeaponModuleType.Legendary;
                }
                else
                {
                    ret[i] = WeaponModuleType.None;
                }
            }

            return(ret);
        }
        private static Image GetWeapon2Image(bool fullScreen)
        {
            var image = ScreenCapture.CaptureScreenRelatively(88.3f, 95f, 95.5f, 98, fullScreen);//77, 97, 95, 99);

            return(image);
        }
Beispiel #5
0
        private static Image GetWeapon1Image()
        {
            var image = ScreenCapture.CaptureScreenRelatively(81f, 87f, 95.5f, 98);//77, 97, 95, 99);

            return(image);
        }