예제 #1
0
 /// <summary>
 /// Called once for each iteration of the bot
 /// </summary>
 /// <returns></returns>
 protected override bool Execute()
 {
     Screen.ReadWindow();
     if (!Inventory.SlotIsEmpty(Inventory.INVENTORY_COLUMNS - 1, Inventory.INVENTORY_ROWS - 4))
     {
         Inventory.DropInventory(false, true);
     }
     else
     {
         Blob rockLocation = StationaryLocateUnminedOre();
         if (rockLocation == null)
         {
             missedRocks++;
             if (missedRocks > 5)
             {
                 MessageBox.Show("Unable to find any iron rocks");
                 return(false);
             }
         }
         else
         {
             Point rockPoint = (Point)rockLocation.RandomBlobPixel();
             LeftClick(rockPoint.X, rockPoint.Y);
             SafeWaitPlus(1200, 100);
             RunParams.Iterations--;
             missedRocks = 0;
         }
     }
     return(true);
 }
예제 #2
0
        protected override bool Execute()
        {
            //Drop kebbit pickups to make room for more.
            if (!Inventory.SlotIsEmpty(18, true))
            {
                Inventory.DropInventory(false);
            }

            List <Kebbit> kebbits = LocateKebbits();

            kebbits = SortAndFilterKebbits(kebbits);
            kebbits = kebbits.GetRange(0, Math.Min(kebbits.Count, 2));   //Only try the first 2 kebbits.

            foreach (Kebbit kebbit in kebbits)
            {
                if (StopFlag)
                {
                    return(false);
                }

                if (HandEye.MouseOverNPC(new Blob(kebbit.Location.Center), true, 1, 500))
                {
                    if (RetrieveFalcon(kebbit.Location.Center))
                    {
                        FailedRuns = 0;
                        RunParams.Iterations--;
                        return(true);
                    }
                    break;  //Don't keep trying after a failed catch attempt.
                }
            }

            FailedRuns++;
            if (FailedRuns >= 5)
            {
                if (FailedRuns % 10 == 0)
                {
                    Minimap.MoveToPosition(225, 0.95, true, 3, 2500, null, 10000);
                    Vision.WaitDuringPlayerAnimation(6000);
                }
                else if (FailedRuns % 5 == 0)
                {
                    Minimap.MoveToPosition(315, 0.95, true, 3, 2500, null, 10000);
                    Vision.WaitDuringPlayerAnimation(6000);
                }
            }
            return(FailedRuns < 60 && !FalconRanAway);
        }
예제 #3
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);
 }
예제 #4
0
        /// <summary>
        /// Called once for each iteration of the bot
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            if (!LocateTrees() || !ChopTree())
            {
                FailedTreeSearches++;
                if (FailedTreeSearches > 10)
                {
                    Inventory.DropInventory(false, true);
                    return(false);
                }
                return(true);
            }

            SafeWait(2000); //Give the player time to start the chopping animation
            Vision.WaitDuringPlayerAnimation();

            //Drop logs when inventory fills up. Use the second from bottom row to avoid looking at the Windows 10 watermark.
            if (!Inventory.SlotIsEmpty(Inventory.INVENTORY_COLUMNS - 1, Inventory.INVENTORY_ROWS - 4))
            {
                Inventory.DropInventory(false, true);
            }
            return(true);
        }