Esempio n. 1
0
        /// <summary>
        /// Fills the small, medium, and large pouches.
        /// Refreshes stamina if it is almost out.
        /// Replaces any depleted jewelry.
        /// </summary>
        /// <param name="refreshStamina">set to true to drink a dose of stamina potion</param>
        /// <returns>true if successful</returns>
        protected bool FillSmallMediumLargePouches()
        {
            Point cursorLocation = new Point(Mouse.X, Mouse.Y);
            Bank  bank;

            if (HandEye.MouseOverStationaryObject(new Blob(cursorLocation), true, 0, 0))    //try mousing over the default guess location first
            {
                bank = new Bank(RSClient, Inventory, Keyboard);
                if (!bank.WaitForPopup(6000))
                {
                    return(false);
                }
            }
            else if (!Banking.OpenBank(out bank, 3))    //Look for the bank if guessing fails
            {
                return(false);
            }

            bank.DepositAll(InventorySlotCraftedRunes);
            BankWithdrawForServicing(bank);
            bank.WithdrawAll(BankSlotPureEssence.X, BankSlotPureEssence.Y);
            bank.Close();

            return(Servicing());
        }
Esempio n. 2
0
        public const int REPAIR_POUCHES_DURATION = NPCContact.NPC_CONTACT_CAST_TIME + 3000; //approximate time needed to go through the full pouch repair process

        /// <summary>
        /// Replenishes pure essence. Drinks a dose of stamina potion on every other trip.
        /// </summary>
        /// <returns></returns>
        protected bool RefreshItems()
        {
            EvaluateStamina();  //determine if the player should drink a dose of stamina potion

            //Fill small-large pouches. Service if not using all four pouches.
            if (StopFlag || !FillSmallMediumLargePouches())
            {
                return(false);
            }

            //Fill huge pouch
            if (StopFlag || UserSelections.NumberOfPouches >= 4 && !FillHugePouch())
            {
                return(false);
            }

            //Refill inventory
            if (UserSelections.NumberOfPouches > 0 || LowStamina)
            {
                Bank bank;
                if (!Banking.OpenBank(out bank))
                {
                    return(false);
                }
                if (LowStamina)
                {
                    bank.DepositItem(InventorySlotStaminaPotion);
                    LowStamina = false;
                }
                bank.WithdrawAll(BankSlotPureEssence.X, BankSlotPureEssence.Y); //don't waste time closing the bank since it will close itself when we start running
            }

            return(true);
        }
Esempio n. 3
0
        /// <summary>
        /// Withdraw half an inventory of secondary ingredients.
        /// </summary>
        /// <returns>true if successful</returns>
        protected bool WithdrawSecondaryIngredients()
        {
            Bank bank;

            if (!Banking.OpenBank(out bank))
            {
                return(false);
            }
            bank.WithdrawX(SecondaryIngredientBankSlot.X, SecondaryIngredientBankSlot.Y, HALF_INVENTORY);
            bank.Close();
            return(true);
        }
Esempio n. 4
0
        /// <summary>
        /// Opens the bank, withdraw 14 ashes + 14 tarromin potions, and closes the bank.
        /// </summary>
        /// <returns>true if successful</returns>
        protected bool WithdrawAshesAndPotions()
        {
            Bank bank;

            if (!Banking.OpenBank(out bank, 2))
            {
                return(false);
            }
            bank.DepositInventory();
            bank.WithdrawX(HerbBankSlot.X, HerbBankSlot.Y, HALF_INVENTORY);
            bank.WithdrawX(VialOfWaterBankSlot.X, VialOfWaterBankSlot.Y, HALF_INVENTORY);
            bank.Close();
            return(true);
        }
Esempio n. 5
0
        /// <summary>
        /// Open bank, withdraw items, close bank, do work with items
        /// </summary>
        /// <returns>true if successful</returns>
        protected override bool Execute()
        {
            Bank bank;

            if (!Banking.OpenBank(out bank) || !WithdrawItems(bank))
            {
                return(false);
            }
            bank.Close();
            if (StopFlag || !ProcessInventory())
            {
                return(false);
            }

            return(true);
        }
Esempio n. 6
0
        /// <summary>
        /// Fills the small, medium, and large pouches.
        /// Refreshes stamina if it is almost out.
        /// </summary>
        /// <param name="refreshStamina">set to true to drink a dose of stamina potion</param>
        /// <returns>true if successful</returns>
        protected bool FillHugePouch()
        {
            Bank bank;

            if (!Banking.OpenBank(out bank))
            {
                return(false);
            }
            if (LowStamina)
            {
                bank.DepositItem(InventorySlotStaminaPotion);
                LowStamina = false;
            }
            bank.WithdrawAll(BankSlotPureEssence.X, BankSlotPureEssence.Y);
            bank.Close();
            Inventory.ClickInventory(InventorySlotGiantPouch);

            return(true);
        }
Esempio n. 7
0
        /// <summary>
        /// Restore hitpoints at the Seers' Village bank and reset location to the Seers' bank teleport before continuing
        /// </summary>
        /// <returns></returns>
        private bool BankAndHeal()
        {
            Bank bank;

            SetFoodSlots(); //Record which inventory slots are currenty empty and will be occupied by food
            if (!Banking.MoveToBank(5000) || !Banking.OpenBank(out bank))
            {
                return(false);
            }
            bank.WithdrawAll(FoodBankSlot.X, FoodBankSlot.Y);
            bank.Close();
            if (!ManageHitpoints() || !Banking.OpenBank(out bank))  //Eat food from initially empty inventory slots until we have very high health.
            {
                return(false);
            }
            DepositFood(bank);
            bank.Close();

            if (!Inventory.StandardTeleport(Inventory.StandardTeleports.Camelot))
            {
                return(Inventory.StandardTeleport(Inventory.StandardTeleports.Camelot, true, true));
            }
            return(true);
        }