Пример #1
0
        /// <summary>
        /// Verifies that the pop-up is roughly the expected size
        /// </summary>
        /// <returns></returns>
        protected virtual void GetPopupHeight(Bitmap screen)
        {
            int yOffset;

            for (int row = 0; row < MAX_ROWS; row++)
            {
                yOffset = RowOffset(row);
                Color       background      = screen.GetPixel(XClick, YClick + yOffset);
                RGBHSBRange rightClickColor = RGBHSBRangeFactory.RightClickPopup();
                if (rightClickColor.ColorInRange(background))
                {
                    Height = TITLE_HEIGHT + ((row + 1) * ROW_HEIGHT);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Determines if the character is currently running.
        /// Assumes the character is running if a stamina potion is active because we cannot differentiate.
        /// </summary>
        /// <returns>true for running, false for walking</returns>
        public bool CharacterIsRunning(bool readWindow = false)
        {
            if (readWindow && !ReadWindow())
            {
                return(false);
            }

            Point       runOrb               = RunOrbSamplePoint();
            Color       runColor             = Screen[runOrb.X, runOrb.Y];
            RGBHSBRange normalRunEnergyFoot  = RGBHSBRangeFactory.RunEnergyFoot();
            RGBHSBRange staminaRunEnergyFoot = RGBHSBRangeFactory.RunEnergyFootStamina();
            bool        normalRun            = normalRunEnergyFoot.ColorInRange(runColor);
            bool        staminaRun           = staminaRunEnergyFoot.ColorInRange(runColor);

            return(normalRun || staminaRun);
        }