Esempio n. 1
0
        /// <summary>
        /// Called once when the bot starts running
        /// </summary>
        protected override bool Run()
        {
            //ReadWindow();
            //DebugUtilities.SaveImageToFile(Bitmap, "C:\\Projects\\Roboport\\test_pictures\\woodcutting\\test.png");

            //ReadWindow();
            //bool[,] bankBooth = ColorFilter(willowTrunk);
            //DebugUtilities.TestMask(Bitmap, ColorArray, willowTrunk, bankBooth, "C:\\Projects\\Roboport\\test_pictures\\mask_tests\\", "willow");

            Inventory.SetEmptySlots();
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Called once when the bot starts running
        /// </summary>
        protected override bool Run()
        {
            //ReadWindow();
            //bool[,] bankBooth = ColorFilter(ironFilter);
            //DebugUtilities.TestMask(Bitmap, ColorArray, ironFilter, bankBooth, "C:\\Users\\markq\\Documents\\runescape_bot\\training_pictures\\ironore\\", "ironRockPic");

            //ReadWindow();
            //bool[,] bankBooth = ColorFilter(RGBHSBRangeFactory.EmptyInventorySlot());
            //DebugUtilities.TestMask(Bitmap, ColorArray, RGBHSBRangeFactory.EmptyInventorySlot(), bankBooth);

            Inventory.SetEmptySlots(); // this tells the inventory to record which spots are empty
            return(true);
        }
Esempio n. 3
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);
                }
            }
        }
Esempio n. 4
0
        protected override bool Run()
        {
            //DebugUtilities.SaveImageToFile(GameScreen);

            //MaskTest(Kebbit.KebbitBlackSpot, "black_spot");
            //MaskTest(KebbitWhiteSpot, "white_spot");
            //MaskTest(KebbitSpottedFur, "spotted_fur");
            //MaskTest(KebbitDashingFur, "dashing_fur");
            //MaskTest(Kebbit.KebbitDarkFur, "dark_dur");
            //MaskTest(FlashingArrow, "arrow");

            //RetrieveFalcon(new Point(957, 502));
            //Inventory.DropInventory(false, false);

            Inventory.SetEmptySlots();
            return(true);
        }
Esempio n. 5
0
 /// <summary>
 /// Called once for each iteration of the bot
 /// </summary>
 /// <returns></returns>
 protected override bool Execute()
 {
     if (!emptySlotsSet)
     {
         Inventory.SetEmptySlots(); // this tells the inventory to record which spots are empty
         for (int x = 0; x < Inventory.INVENTORY_COLUMNS; x++)
         {
             for (int y = Inventory.INVENTORY_ROWS - 2; y < Inventory.INVENTORY_ROWS; y++)
             {
                 Inventory.SetEmptySlot(x, y, false);
             }
         }
         emptySlotsSet = true;
     }
     Screen.ReadWindow();
     if (!Inventory.SlotIsEmpty(Inventory.INVENTORY_COLUMNS - 1, Inventory.INVENTORY_ROWS - 3, true))
     {
         Inventory.DropInventory(false, true);
     }
     else
     {
         if (!IsCurrentlyFishing())
         {
             Blob fishLocation = Vision.LocateClosestObject(FishTileFilter);
             if (fishLocation != null)
             {
                 if (fishLocation.Center.X != 0 && fishLocation.Center.Y != 0)
                 {
                     Point fishPoint = (Point)fishLocation.RandomBlobPixel();
                     LeftClick(fishPoint.X, fishPoint.Y);
                     Mouse.RadialOffset(187, 689, 6, 223);
                     SafeWaitPlus(8000, 1200);
                 }
             }
             else if (!MoveToNewFishingSpot())
             {
                 return(false);
             }
         }
     }
     return(true);
 }