Esempio n. 1
0
 public static void CrateRestoredArtifact()
 {
     foreach (WoWItem item in ObjectManager.ObjectManager.GetObjectWoWItem())
     {
         Memory.WowMemory.GameFrameLock();
         string spellname = ItemsManager.GetItemSpell(item.Entry);
         if (spellname == _CrateRestoredArtifactSpellName)
         {
             Memory.WowMemory.GameFrameUnLock();
             ItemsManager.UseItem(item.Entry);
             Thread.Sleep(500 + Usefuls.Latency);
             while (ObjectManager.ObjectManager.Me.IsCast)
             {
                 Thread.Sleep(150);
             }
         }
     }
     Memory.WowMemory.GameFrameUnLock();
 }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public static int SolveAllArtifact(bool useKeystone)
        {
            try
            {
                int nbSolved = 0;
                if (archaeologySpell == null)
                {
                    archaeologySpell = new Spell("Archaeology");
                }

                Lua.RunMacroText("/cast " + archaeologySpell.NameInGame);
                int j = 1;
                while (j <= 18)
                {
                    Lua.RunMacroText("/click ArchaeologyFrameSummaryButton");
                    if (j == 13)
                    {
                        Lua.RunMacroText("/click ArchaeologyFrameSummarytButton");
                        Lua.RunMacroText("/click ArchaeologyFrameSummaryPageNextPageButton");
                    }
                    string buttonName;
                    if (j > 12)
                    {
                        buttonName = "ArchaeologyFrameSummaryPageRace" + (j - 12);
                    }
                    else
                    {
                        buttonName = "ArchaeologyFrameSummaryPageRace" + j;
                    }

                    if (IsButtonActive(buttonName))
                    {
                        Lua.RunMacroText("/click " + buttonName);
                    }
                    else
                    {
                        j++;
                        continue;
                    }
                    Thread.Sleep(200 + Usefuls.Latency);
                    if (useKeystone)
                    {
                        bool moreToSocket;
                        do
                        {
                            moreToSocket = false;
                            string randomString1 = Others.GetRandomString(Others.Random(4, 10));
                            string randomString2 = Others.GetRandomString(Others.Random(4, 10));
                            Lua.LuaDoString(randomString1 + " = SocketItemToArtifact(); if " + randomString1 + " then " + randomString2 + "=\"1\" else " + randomString2 + "=\"0\" end");
                            if (Lua.GetLocalizedText(randomString2) == "1")
                            {
                                moreToSocket = true;
                                Thread.Sleep(250 + Usefuls.Latency);
                            }
                        } while (moreToSocket);
                    }
                    string randomString3 = Others.GetRandomString(Others.Random(4, 10));
                    string randomString4 = Others.GetRandomString(Others.Random(4, 10));
                    Lua.LuaDoString(randomString3 + " = CanSolveArtifact(); if " + randomString3 + " then " + randomString4 + "=\"1\" else " + randomString4 + "=\"0\" end");
                    bool canSolve = Lua.GetLocalizedText(randomString4) == "1";
                    if (canSolve)
                    {
                        nbSolved++;
                        Lua.RunMacroText("/click ArchaeologyFrameArtifactPageSolveFrameSolveButton");
                        if (Usefuls.GetContainerNumFreeSlots >= 1)
                        {
                            j--;
                        }
                        Thread.Sleep(2050 + Usefuls.Latency); // Spell cast time is 2.0secs
                    }
                    j++;
                    Thread.Sleep(200 + Usefuls.Latency);
                }
                Lua.RunMacroText("/click ArchaeologyFrameCloseButton");
                if (ObjectManager.ObjectManager.Me.Level < 90 || Usefuls.GetContainerNumFreeSlots <= 0)
                {
                    return(nbSolved);
                }
                for (int i = 79896; i <= 79917; i++)
                {
                    if (i == 79906 || i == 79907)
                    {
                        continue;
                    }
                    WoWItem item = ObjectManager.ObjectManager.GetWoWItemById(i);
                    if (item == null || !item.IsValid || ItemsManager.IsItemOnCooldown(i) ||
                        !ItemsManager.IsItemUsable(i))
                    {
                        continue;
                    }
                    while (ItemsManager.GetItemCount(i) > 0)
                    {
                        MountTask.DismountMount();
                        ItemsManager.UseItem(i);
                        Thread.Sleep(1550 + Usefuls.Latency); // Spell cast time is 1.5secs
                    }
                }
                for (int i = 95375; i <= 95382; i++)
                {
                    WoWItem item = ObjectManager.ObjectManager.GetWoWItemById(i);
                    if (item == null || !item.IsValid || ItemsManager.IsItemOnCooldown(i) ||
                        !ItemsManager.IsItemUsable(i))
                    {
                        continue;
                    }
                    while (ItemsManager.GetItemCount(i) > 0)
                    {
                        MountTask.DismountMount();
                        ItemsManager.UseItem(i);
                        Thread.Sleep(1550 + Usefuls.Latency); // Spell cast time is 1.5secs
                    }
                }
                return(nbSolved);
            }
            catch (Exception e)
            {
                Logging.WriteError("Archaeology >  solveAllArtifact(): " + e);
                return(0);
            }
        }
Esempio 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);
     }
 }
Esempio 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);
            }
        }