/// <summary> /// Sets the filter colors for the obstacles /// </summary> private void GetReferenceColors() { LogBalance = RGBHSBRangeFactory.LogBalance(); CargoNet = RGBHSBRangeFactory.CargoNetFrameTop(); TreeBranch = RGBHSBRangeFactory.GnomeTreeBranch(); TreeTrunk = RGBHSBRangeFactory.GnomeTreeTrunk(); Tightrope = RGBHSBRangeFactory.Tightrope(); DrainPipe = RGBHSBRangeFactory.DrainPipe(); Black = RGBHSBRangeFactory.Black(); }
/// <summary> /// Checks the area where the title bar should be for blackness /// </summary> /// <param name="screen">the full game screen</param> /// <returns>true if the black popup title bar is found</returns> protected bool PopupExists(Color[,] screen) { int top = YClick + 1; int bottom = top + TITLE_HEIGHT - 1; int left = XClick - MIN_WIDTH / 2; int right = XClick + MIN_WIDTH / 2; double blackness = ImageProcessing.FractionalMatchPiece(screen, RGBHSBRangeFactory.Black(), left, right, top, bottom); return(blackness > 0.25); }
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(); }
/// <summary> /// Determines if the chat box is currently open /// </summary> /// <returns></returns> protected bool ChatBoxIsOpen(bool readWindow = false) { if (readWindow) { Screen.ReadWindow(); } int left = 11; int right = left + 30; int top = Screen.Height - 43; int bottom = top + 13; Color[,] chatName = Vision.ScreenPiece(left, right, top, bottom); double textMatch = ImageProcessing.FractionalMatch(chatName, RGBHSBRangeFactory.Black()); double backgroundMatch = ImageProcessing.FractionalMatch(chatName, RGBHSBRangeFactory.ChatBoxBackground()); return(textMatch > 0.05 && backgroundMatch > 0.5); }