Exemplo n.º 1
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);
 }