Exemplo n.º 1
0
        /// <summary>
        /// Drinks a dose of absorption potion if the absorption shield is low
        /// </summary>
        /// <returns>true if a dose of absorption is consumed</returns>
        protected bool Absorption()
        {
            if (!hasAbsorptions || AbsorptionShieldIsHigh())
            {
                return(false); //The absorption shield is already high or we ran out of absorptions to drink
            }

            Point?firstAbsorption = Inventory.FirstColorMatchingSlot(AbsorptionInventory, 0.01, false);

            if (firstAbsorption == null || !firstAbsorption.HasValue)
            {
                hasAbsorptions = false;
                return(false);
            }

            Inventory.ClickInventory(firstAbsorption.Value, false);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Drinks a dose of overload if the timer does not show up above the chat box
        /// </summary>
        /// <returns>true if a dose of overload is consumed</returns>
        protected bool Overload()
        {
            if (!hasOverloads || OverloadTimerExists() || (DateTime.Now - lastOverload).TotalMilliseconds < overloadDrainTime)
            {
                return(false);   //An overload is active or we ran out of overloads to drink
            }

            Point?firstOverload = Inventory.FirstColorMatchingSlot(OverloadInventory, 0.01, false);

            if (firstOverload == null || !firstOverload.HasValue)
            {
                hasOverloads = false;
                return(false);
            }

            Inventory.ClickInventory(firstOverload.Value, false);
            lastOverload = DateTime.Now;
            return(true);
        }