예제 #1
0
        /// <summary>
        /// Waits for the disappearance of the red flag on the minimap which indicates the target to move to
        /// </summary>
        /// <param name="timeout">maximum time to wait for the red flag to disappear</param>
        /// <returns>true if the red flag disappears</returns>
        public bool WaitDuringMovement(int timeout = 30000, int startupWait = 0)
        {
            const int redFlagMinSize = 20;  //ex 28
            const int redFlagMaxSize = 43;
            Stopwatch watch          = new Stopwatch();

            watch.Start();
            Blob redFlag;

            BotProgram.SafeWait(startupWait);
            while (watch.ElapsedMilliseconds < timeout)
            {
                if (BotProgram.StopFlag)
                {
                    return(false);
                }
                ReadWindow();
                redFlag = LocateObject(RGBHSBRangeFactory.GenericColor(Color.Red), redFlagMinSize, redFlagMaxSize);
                if (redFlag == null)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
 private void SetColors()
 {
     BankChest         = RGBHSBRangeFactory.BankChest();
     HousePortalPurple = RGBHSBRangeFactory.HousePortalPurple();
     BlueMouseOverText = RGBHSBRangeFactory.MouseoverTextStationaryObject();
     DemonHead         = RGBHSBRangeFactory.LesserDemonSkin();
     DialogTitle       = RGBHSBRangeFactory.DialogBoxTitle();
     DialogBody        = RGBHSBRangeFactory.Black();
     ContinueBarBlue   = RGBHSBRangeFactory.GenericColor(Color.Blue);
     BackpackBrown     = RGBHSBRangeFactory.BackpackBrown();
 }