예제 #1
0
        /// <summary>
        /// Determines if the bank screen is currently visible
        /// </summary>
        /// <returns>true if the bank is open</returns>
        public bool NPCContactIsOpen()
        {
            int left   = Left + 182;
            int right  = Left + 316;
            int top    = Top + 12;
            int bottom = Top + 25;

            Color[,] screen;
            screen = ScreenScraper.GetRGB(ScreenScraper.CaptureWindow());
            screen = ImageProcessing.ScreenPiece(screen, left, right, top, bottom);
            double titleMatch = ImageProcessing.FractionalMatch(screen, RGBHSBRangeFactory.BankTitle());

            return(titleMatch > 0.05);
        }
예제 #2
0
        /// <summary>
        /// Determines if the bank screen is currently visible
        /// </summary>
        /// <returns>true if the bank is open</returns>
        public bool BankIsOpen()
        {
            const double minTitleMatch = 0.05;
            double       titleMatch;
            int          left   = Left + 162;
            int          right  = Left + 325;
            int          top    = Top + 8;
            int          bottom = Top + 25;

            Color[,] screen;
            screen     = ScreenScraper.GetRGB(ScreenScraper.CaptureWindow());
            screen     = ImageProcessing.ScreenPiece(screen, left, right, top, bottom);
            titleMatch = ImageProcessing.FractionalMatch(screen, RGBHSBRangeFactory.BankTitle());

            return(titleMatch > minTitleMatch);
        }
예제 #3
0
        /// <summary>
        /// Determines if the world switcher is open
        /// </summary>
        /// <returns>true if the world switcher is open</returns>
        public bool WorldSwitcherIsOpen()
        {
            int left   = Width - 200;
            int right  = left + 150;
            int top    = Height - 297;
            int bottom = top + 20;

            Color[,] currentWorldTitle = ImageProcessing.ScreenPiece(Value, left, right, top, bottom);
            double       worldTextMatch        = ImageProcessing.FractionalMatch(currentWorldTitle, RGBHSBRangeFactory.BankTitle());
            const double worldTextMinimumMatch = 0.05;

            return(worldTextMatch > worldTextMinimumMatch);
        }
예제 #4
0
        /// <summary>
        /// Determines if house options is open
        /// </summary>
        /// <returns>true if the world switcher is open</returns>
        protected bool HouseOptionsIsOpen()
        {
            Inventory.OpenOptions(false);
            Screen.ReadWindow();
            int left   = Screen.Width - 169;
            int right  = left + 100;
            int top    = Screen.Height - 296;
            int bottom = top + 20;

            Color[,] houseOptionsTitle = Vision.ScreenPiece(left, right, top, bottom);
            double       houseOptionsMatch        = ImageProcessing.FractionalMatch(houseOptionsTitle, RGBHSBRangeFactory.BankTitle());
            const double houseOptionsMinimumMatch = 0.05;

            return(houseOptionsMatch > houseOptionsMinimumMatch);
        }