Ejemplo n.º 1
0
        /// <summary>
        /// Moves the character to a bank icon on the minimap
        /// </summary>
        /// <returns>true if the bank icon is found</returns>
        internal virtual bool MoveToBank(int maxRunTimeToBank = 10000, bool readWindow = true, int minBankIconSize = 4, int randomization = 3, Point?moveTarget = null)
        {
            if (readWindow)
            {
                Screen.ReadWindow();
            }
            if (moveTarget == null)
            {
                moveTarget = new Point(0, 0);
            }

            Point offset;

            bool[,] minimapBankIcon = Minimap.MinimapFilter(RGBHSBRangeFactory.BankIconDollar(), out offset);
            Blob bankBlob = ImageProcessing.BiggestBlob(minimapBankIcon);

            if (bankBlob == null || bankBlob.Size < minBankIconSize)
            {
                return(false);
            }

            Point clickLocation = new Point(offset.X + bankBlob.Center.X + moveTarget.Value.X, offset.Y + bankBlob.Center.Y + moveTarget.Value.Y);

            Mouse.LeftClick(clickLocation.X, clickLocation.Y, randomization);
            BotProgram.SafeWait(maxRunTimeToBank);

            return(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads default color ranges
 /// </summary>
 private void GetReferenceColors()
 {
     FurnaceIconOrange = RGBHSBRangeFactory.FurnaceIconOrange();
     BankIconDollar    = RGBHSBRangeFactory.BankIconDollar();
     BuildingFloor     = RGBHSBRangeFactory.PhasmatysBuildingFloorLight();
     Furnace           = RGBHSBRangeFactory.Furnace();
     BankBooth         = RGBHSBRangeFactory.BankBoothPhasmatys();
 }