/// <summary> /// Tries to find a knight to click on without being able to see a purple cloak. /// Adjust position if the knight is found on the same grid square row as the player. /// </summary> /// <returns></returns> protected bool BlindSearch() { Point guess = new Point(Screen.Center.X + (BlindSpot.X * GridSquareHeight), Screen.Center.Y + (BlindSpot.Y * GridSquareHeight)); if (HandEye.MouseOver(guess, NPCMouseover, true, NPCClickRandomization)) { return(true); } for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { if (StopFlag) { return(false); } guess = new Point(Screen.Center.X + (x * GridSquareHeight), Screen.Center.Y + (y * GridSquareHeight)); if (HandEye.MouseOver(guess, NPCMouseover, true, NPCClickRandomization)) { BlindSpot = new Point(x, y); return(true); } } } FailedCloakSearches++; return(false); }
/// <summary> /// Clicks on a knight 10 times in short succession /// </summary> /// <param name="clickInterval">target time between clicks in milliseconds</param> /// <param name="clicks">number of pickpocket clicks to perform</param> /// <returns>true if a knight is clicked on</returns> protected bool ClickKnight(int clicks) { Stopwatch watch = new Stopwatch(); Blob purpleCloak; for (int i = 0; i < clicks; i++) { watch.Restart(); if (StopFlag) { return(false); } if (Vision.LocateStationaryObject(KnightPurple, out purpleCloak, Screen.ArtifactLength(0.015), 10000, MinPurpleCloakSize, int.MaxValue, Vision.LocateClosestObject, 1)) { if (CheckPosition(purpleCloak.Center)) { if (StopFlag) { return(false); } if (HandEye.MouseOver(purpleCloak.Center, NPCMouseover, true, 0)) { FailedCloakSearches = 0; } else { FailedCloakSearches++; } if (SafeWait(Math.Max(0, PICKPOCKET_TIME - watch.ElapsedMilliseconds), 200)) { return(false); } } } else { BlindSearch(); } } return(FailedCloakSearches < 300); }
/// <summary> /// Clicks on the window that starts the Seers' Village agility course /// </summary> /// <returns>true if successful</returns> private bool ClimbBank() { int left = Screen.Center.X; int right = Screen.Width - 1; int top = 0; int bottom = Screen.Center.Y; List <Blob> possibleBankWalls = Vision.LocateObjects(BankWall, left, right, top, bottom, true, Screen.ArtifactArea(0.00004), Screen.ArtifactArea(0.0004)); //ex 0.0000803, 0.0004 Point? expectedWallLocation = ExpectedBankWallLocation(); if (expectedWallLocation == null) { return(false); } possibleBankWalls.Sort(new BlobProximityComparer((Point)expectedWallLocation)); if (HandEye.MouseOver(possibleBankWalls, StationaryObjectText, true, 6, 1600)) { SafeWait(4500); MoveMouse(Screen.Center.X - Screen.ArtifactLength(0.511), Screen.Center.Y - Screen.ArtifactLength(0.065)); return(true); } return(false); }