Beispiel #1
0
        /// <summary>
        /// Manually uses each ashes on a tarromin potions to make serums.
        /// </summary>
        /// <returns>true if successful</returns>
        protected bool MakeSerums()
        {
            Point ashesInventorySlot;
            Point tarrominPotionInventorySlot;

            for (int i = 0; i < HALF_INVENTORY; i++)
            {
                if (StopFlag)
                {
                    return(false);
                }

                ashesInventorySlot = Inventory.InventoryIndexToCoordinates(i);
                if (ashesInventorySlot.Y % 2 == 1)  //Iterate through odd rows right to left instead of left to right like on even rows.
                {
                    ashesInventorySlot = Inventory.MirrorHorizontal(ashesInventorySlot);
                }
                tarrominPotionInventorySlot = Inventory.MirrorVertical(ashesInventorySlot);

                if (i % 2 == 0)
                {   //Use top half item on mirrored bottom half item.
                    Inventory.UseItemOnItem(ashesInventorySlot, tarrominPotionInventorySlot, false);
                }
                else
                {   //Use bottom half item on mirrored top half item.
                    Inventory.UseItemOnItem(tarrominPotionInventorySlot, ashesInventorySlot, false);
                }

                RunParams.Iterations--;
            }
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Sets slots in inventory and bank where items are expected to be
        /// </summary>
        protected void SetItemSlots()
        {
            BankSlotPureEssence       = new Point(7, 0);
            BankSlotStaminaPotion     = new Point(6, 0);
            BankSlotCosmicRunes       = new Point(5, 0);
            BankSlotAstralRunes       = new Point(4, 0);
            BankSlotAirRunes          = new Point(3, 0);
            BankSlotAmuletOfGlory     = new Point(2, 0);
            BankSlotChargeDragonstone = new Point(1, 0);
            BankSlotStaminaPotions    = new Point[4];
            BankSlotStaminaPotions[0] = new Point(5, 1);
            BankSlotStaminaPotions[1] = new Point(6, 1);
            BankSlotStaminaPotions[2] = new Point(7, 1);
            BankSlotStaminaPotions[3] = BankSlotStaminaPotion;

            InventorySlotSmallPouch  = new Point(0, 0);
            InventorySlotMediumPouch = new Point(1, 0);
            InventorySlotLargePouch  = new Point(2, 0);
            InventorySlotGiantPouch  = new Point(3, 0);
            PouchSlots    = new Point[4];
            PouchSlots[0] = InventorySlotSmallPouch;
            PouchSlots[1] = InventorySlotMediumPouch;
            PouchSlots[2] = InventorySlotLargePouch;
            PouchSlots[3] = InventorySlotGiantPouch;

            InventorySlotCraftedRunes  = Inventory.InventoryIndexToCoordinates(UserSelections.NumberOfPouches);
            InventorySlotEssenceCheck  = Inventory.InventoryIndexToCoordinates(UserSelections.NumberOfPouches + 1);
            InventorySlotStaminaPotion = InventorySlotCraftedRunes;
            InventoryDepletedGlory     = Inventory.InventoryIndexToCoordinates(UserSelections.NumberOfPouches + 1);
        }
Beispiel #3
0
        public Herblore(RunParams startParams) : base(startParams)
        {
            SingleMakeTime = MAKE_FINISHED_POTION_TIME;
            MakeQuantity   = HALF_INVENTORY;

            HerbBankSlot                = new Point(7, 0);
            VialOfWaterBankSlot         = new Point(6, 0);
            SecondaryIngredientBankSlot = new Point(5, 0);

            FirstHalfInventorySlot  = Inventory.InventoryIndexToCoordinates(Inventory.INVENTORY_CAPACITY / 2 - 1);
            SecondHalfInventorySlot = Inventory.InventoryIndexToCoordinates(Inventory.INVENTORY_CAPACITY / 2);
        }
Beispiel #4
0
        /// <summary>
        /// Deposits leftover food into the bank. Assumes that the bank is open. Does not close the bank.
        /// </summary>
        protected void DepositFood(Bank bank)
        {
            Point slot;

            for (int i = 0; i < EmptySlots.Length; i++)
            {
                slot = Inventory.InventoryIndexToCoordinates(i);
                if (EmptySlots[slot.X, slot.Y] && !Inventory.SlotIsEmpty(i, false, false))
                {
                    bank.DepositAll(slot);
                    SafeWait(3 * BotRegistry.GAME_TICK);
                    Screen.ReadWindow();
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Makes a queue of inventory slots with food in them in the order that they should be eaten
        /// </summary>
        protected override void SetFoodSlots()
        {
            FoodSlots = new Queue <int>();
            Inventory.SetEmptySlots();
            EmptySlots = Inventory.GetEmptySlots;
            Point inventorySlot;

            for (int i = 0; i < EmptySlots.Length - 8; i++) //don't touch the bottom 2 rows
            {
                inventorySlot = Inventory.InventoryIndexToCoordinates(i);
                if (EmptySlots[inventorySlot.X, inventorySlot.Y])
                {
                    FoodSlots.Enqueue(i);
                }
            }
        }
Beispiel #6
0
        protected override bool ProcessInventory()
        {
            Stopwatch watch = new Stopwatch();

            for (int i = 1; i < Inventory.INVENTORY_CAPACITY; i++)
            {
                Point inventorySlot = Inventory.InventoryIndexToCoordinates(i);
                if (!Inventory.Enchant(inventorySlot.X, inventorySlot.Y, EnchantLevel, false, false))
                {
                    return(false);
                }
                SafeWaitPlus(1200, 100);
                RunParams.Iterations--;
                if (RunParams.Iterations <= 0 || StopFlag)
                {
                    return(false);
                }
            }
            return(true);
        }