Ejemplo n.º 1
0
 public static string FishingPolesName()
 {
     try
     {
         foreach (int i in ListFishingPoles)
         {
             if (ItemsManager.GetItemCount(i) > 0)
             {
                 return(ItemsManager.GetItemNameById(i));
             }
         }
     }
     catch (Exception e)
     {
         Logging.WriteError("Fishing > FishingPolesName(): " + e);
     }
     return("");
 }
Ejemplo n.º 2
0
 public static void EquipFishingPoles(string fishingPoleName = "")
 {
     try
     {
         if (!ReCheckFishingPoleTimer.IsReady || IsEquipedFishingPoles())
         {
             return;
         }
         Logging.WriteDebug("Parsing inventory to find a Fishing Pole to equip.");
         if (fishingPoleName != string.Empty)
         {
             ItemsManager.EquipItemByName(fishingPoleName);
             Thread.Sleep(500);
             Thread.Sleep(Usefuls.Latency);
             while (ObjectManager.ObjectManager.Me.IsCast)
             {
                 Thread.Sleep(200);
             }
         }
         else
         {
             foreach (int i in ListFishingPoles)
             {
                 if (ItemsManager.GetItemCount(i) > 0)
                 {
                     ItemsManager.EquipItemByName(ItemsManager.GetItemNameById(i));
                     Thread.Sleep(500);
                     Thread.Sleep(Usefuls.Latency);
                     while (ObjectManager.ObjectManager.Me.IsCast)
                     {
                         Thread.Sleep(200);
                     }
                     break;
                 }
             }
         }
         ReCheckFishingPoleTimer = new Timer(1000 * 60 * 5);
         Logging.WriteDebug("Inventory parsed, prevent this function from being parsed for the next five minutes.");
     }
     catch (Exception e)
     {
         Logging.WriteError("Fishing > EquipFishingPoles(string fishingPoleName = \"\"): " + e);
     }
 }
Ejemplo n.º 3
0
        public static void Item(int Entry, Point point)
        {
            if (Entry <= 0)
            {
                return;
            }
            if (point == null)
            {
                return;
            }
            if (!point.IsValid)
            {
                return;
            }

            ItemsManager.UseItem(ItemsManager.GetItemNameById(Entry));


            Thread.Sleep(Usefuls.Latency * 2);

            Pulse(point);
        }
Ejemplo n.º 4
0
 public static void UseLure(string lureName = "", bool automaticallyUseDraenorBait = false)
 {
     try
     {
         if (automaticallyUseDraenorBait)
         {
             UseDraenicBait();
         }
         if (!IsEquipedFishingPoles())
         {
             return;
         }
         if (ObjectManager.ObjectManager.Me.IsMainHandTemporaryEnchanted)
         {
             return; // Already lured up.
         }
         if (lureName != string.Empty)
         {
             if (ItemsManager.GetItemCount(ItemsManager.GetItemIdByName(lureName)) > 0)
             {
                 ItemsManager.UseItem(lureName);
                 Thread.Sleep(1000);
                 Thread.Sleep(Usefuls.Latency);
                 while (ObjectManager.ObjectManager.Me.IsCast)
                 {
                     Thread.Sleep(200);
                 }
                 return;
             }
             else
             {
                 Spell lureSpell = new Spell(lureName);
                 if (lureSpell.KnownSpell && lureSpell.IsSpellUsable)
                 {
                     lureSpell.Launch();
                     return;
                 }
                 if (!lureSpell.KnownSpell)
                 {
                     if (FirstLureCheck)
                     {
                         Logging.Write("Lure from Product Settings is missing, try to use a lure from the list built-in TheNoobBot.");
                         FirstLureCheck = false;
                     }
                 }
             }
         }
         foreach (int i in listLure)
         {
             if (ItemsManager.GetItemCount(i) > 0)
             {
                 ItemsManager.UseItem(ItemsManager.GetItemNameById(i));
                 Thread.Sleep(1000);
                 while (ObjectManager.ObjectManager.Me.IsCast)
                 {
                     Thread.Sleep(200);
                 }
                 break;
             }
         }
     }
     catch (Exception e)
     {
         Logging.WriteError("Fishing > UseLure(string lureName = \"\"): " + e);
     }
 }
Ejemplo n.º 5
0
        public static void UseDraenicBait()
        {
            if (Usefuls.ContinentId != 1116 && Usefuls.ContinentId != 1464 || HaveDraenicBaitBuff())
            {
                return;
            }
            int baitToUse = 0;

            if (Usefuls.AreaId == 7004 || Usefuls.AreaId == 7078)
            {
                // Frostwall Horde garrison or Lunarfall Alliance garrison
                baitToUse = GetRandomDraenicBait();
            }
            else if (DraenorSeasList.Contains(Usefuls.SubAreaId))
            {
                baitToUse = DraenicBaitList[6];
            }
            else if (Usefuls.AreaId == 6719)
            {
                // Shadowmoon Valley
                baitToUse = DraenicBaitList[0];
            }
            else if (Usefuls.AreaId == 6720)
            {
                // Frostfire Ridge
                baitToUse = DraenicBaitList[1];
            }
            else if (Usefuls.AreaId == 6721)
            {
                // Gorgrond
                baitToUse = DraenicBaitList[2];
            }
            else if (Usefuls.AreaId == 6722)
            {
                // Spires of Arak
                baitToUse = DraenicBaitList[3];
            }
            else if (Usefuls.AreaId == 6662)
            {
                // Talador
                baitToUse = DraenicBaitList[4];
            }
            else if (Usefuls.AreaId == 6755)
            {
                // Nagrand
                baitToUse = DraenicBaitList[5];
            }
            else if (Usefuls.ContinentId == 1464)
            {
                baitToUse = 128229; // Felmouth Frenzy Bait can't be used in Garrison.
            }

            if (baitToUse == 0 || ItemsManager.GetItemCount(baitToUse) <= 0)
            {
                return;
            }
            string baitToUseName = ItemsManager.GetItemNameById(baitToUse);

            if (ItemsManager.IsItemUsable(baitToUseName))
            {
                ItemsManager.UseItem(baitToUseName);
            }
        }