/// <summary> /// Empties the giant pouch and crafts its runes. /// Does nothing if the user is not using a giant pouch. /// </summary> /// <returns>true if successful</returns> protected bool CraftGiantPouch() { if (UserSelections.NumberOfPouches < 4) { return(true); } Inventory.RightClickInventoryOption(InventorySlotGiantPouch.X, InventorySlotGiantPouch.Y, 1); Point equipmentSlot = new Point(Screen.Width - Inventory.TAB_RIGHT_OFFSET_RIGHT - 2 * Inventory.TAB_HORIZONTAL_GAP); CraftInventory(new Point(Screen.Center.X, Screen.Center.Y - Screen.ArtifactLength(0.120)), null); WaitForRunesToCraft(true); return(true); }
/// <summary> /// Eats a bite of rock cake if hitpoints are above 1 /// </summary> /// <returns>true if a bite of rock cake is taken</returns> protected bool Hitpoints() { if (TimeSinceLastOverload < overloadDrainTime || Numerical.CloseEnough(overloadBoostTime, TimeSinceLastOverload, 0.02)) { return(false); //an overload might be taking effect or wearing off } const double oneHitpoint = 0.035714285714285712; RectangleBounds hitpoints = Minimap.HitpointsDigitsArea(); double redHitpointsMatch = Vision.FractionalMatchPiece(HitpointsRed, hitpoints.Left, hitpoints.Right, hitpoints.Top, hitpoints.Bottom); if (Numerical.WithinRange(redHitpointsMatch, oneHitpoint, 0.01 * oneHitpoint) || (Minimap.Hitpoints() > 0.25)) { return(false); //hitpoints are already at 1 or an overload has just worn off and hitpoints are no longer red } Inventory.RightClickInventoryOption(0, 0, 1, false); //guzzle rock cake SafeWaitPlus(1000, 250); return(true); }