Esempio n. 1
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();
 }
Esempio n. 2
0
        /// <summary>
        /// Tries each found tree from closest to farthest away until an actual tree is confirmed
        /// </summary>
        /// <returns>true if a tree is found and chopped, false if no tree is confirmed found</returns>
        protected bool ChopTree()
        {
            Point click;

            foreach (Blob tree in Trees)
            {
                if (StopFlag)
                {
                    return(false);
                }

                click = tree.Center;
                click = Probability.GaussianCircle(click, 3);
                Mouse.Move(click.X, click.Y);

                if (Vision.WaitForMouseOverText(RGBHSBRangeFactory.MouseoverTextStationaryObject(), 1000))
                {
                    LeftClick(click.X, click.Y, 0, 0);
                    FailedTreeSearches = 0;
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 3
0
 private void GetReferenceColors()
 {
     TeaStallRoof  = RGBHSBRangeFactory.TeaStallRoof();
     MouseOverText = RGBHSBRangeFactory.MouseoverTextStationaryObject();
 }
Esempio n. 4
0
 /// <summary>
 /// Mouses over an alleged stationary object. Left-clicks if the stationary object text appears.
 /// </summary>
 /// <param name="stationaryObject">alleged stationary object</param>
 /// <param name="click">set to false to skip clicking on the stationary object</param>
 /// <param name="randomization">maximum number of pixels from the center of the blob that it is safe to click</param>
 /// <returns>true if a matching stationary object is found and clicked on</returns>
 internal bool MouseOverStationaryObject(Blob stationaryObject, bool click = true, int randomization = 5, int maxWait = 1000)
 {
     return(MouseOver(stationaryObject.Center, RGBHSBRangeFactory.MouseoverTextStationaryObject(), click, randomization, maxWait));
 }