Jump to content

TheSmokie

Banned
  • Posts

    1215
  • Joined

Posts posted by TheSmokie

  1. While i was working on my own copy of AIO, i made a simple way to check spec by string, its more Accurate then the method @iMod used, 

    public static class ToolHelper_Rotation
    {
        public static void Spec()
        {
            string MainTalents = GetSpec();
            if (ObjectManager.Me.WowClass == WoWClass.Priest)
            {
                switch (MainTalents)
                {
                    case ("Shadow"):
                        {
                            MessageBox.Show("Your spec is Shadow");
                            break;
                        }
                    case ("Holy"):
                        {
                            MessageBox.Show("Your spec is Holy");
                            break;
                        }
                    case ("Disco"):
                        {
                            MessageBox.Show("Your spec is Disco");
                            break;
                        }
                    default:
                        {
                            MessageBox.Show("Your spec is Shadow");
                            break;
                        }
                }
            }
        }
    
        public static string GetSpec()
        {
            string SpecName = @"    
            local highest_tab, highest = 0, 0;
            for i=1, 3 do 
            local name, _, points = GetTalentTabInfo(i);
            if points > highest then
                highest = points;
                highest_tab = i;
                highest_name = name
            end
            end
            return highest_name";
            return Lua.LuaDoString<string>(SpecName);
        }
    }

     

  2. Hello, there is many ways to do what you are asking, C# and lua.

    Take your pick of one that works for you.

    1st :
    string ItemName = ItemsManager.GetNameById(50259);
    Lua.LuaDoString("UseItemByName('" + ItemName+ "')");
    
    2nd :
    ItemsManager.UseItemByNameOrId("50259");
    
    3rd:
    ItemsManager.UseItem(555);
    
    4th : 
    ItemsManager.UseContainerItem("Name here");
    
    5th : 
    Lua.LuaDoString("UseItemByName('ItemName Here')");

     

  3. This is what i use for my upcoming profile, i added its own Npc database and each file clears the database.

    var npcVendor = new wManager.Wow.Class.Npc
    						{
    							ContinentId = (wManager.Wow.Enums.ContinentId)Usefuls.ContinentId,
    							Entry = 1234,
    							Faction = wManager.Wow.Class.Npc.FactionType.Neutral,
    							Name = "Npc name",
    							Position = new Vector3(1, 2, 3),
    							CanFlyTo = true,
    							Type = wManager.Wow.Class.Npc.NpcType.Repair, // wManager.Wow.Class.Npc.NpcType.Vendor
    						};
    						if(!NpcDB.ListNpc.Contains(npcVendor))
    							NpcDB.AddNpc(npcVendor, false);

     

  4. instead of using macros with turn off, turn on (your gonna get some errors no matter what,) use this template for make your own plugin

    using robotManager.Helpful;
    using robotManager.Products;
    using System;
    using System.Threading;
    using System.Windows.Forms;
    using wManager.Plugin;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    
    public class Main : IPlugin
    {
        bool Launched;
    	int timer = 1000;
    	string PluginName = "[Plugin]: ";
    
        public void Initialize()
        {
            Launched = true;
    		while (Launched && Products.IsStarted)
    		{
    			try
    			{
    				if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
    				{
    					
    					if (!ObjectManager.Me.InCombat && !ObjectManager.Me.IsDead)
    					{
    						Lua.RunMacroText("Code here");
    
    					}
    					
    				}
    			}
    			catch (Exception e)
    			{
    				Logging.WriteError(PluginName + "there was an error: " + e);
    			}
    			Thread.Sleep(timer);
    		}
    	}
    
        public void Dispose()
        {
            Launched = false;
        }
    
        public void Settings()
        {
    		MessageBox.Show(PluginName + "There are no settings.");
        }
    }

     

  5. @pudge i do not know if you fix this problem, but i got it working by using this as a return complete condition.

    return Usefuls.SubMapZoneName.Contains("The Vault of Lights");
    
    if(GoToTask.ToPositionAndIntecractWithGameObject(new Vector3(5699.33, 735.217, 641.767), 191007))
                    {
    					Thread.Sleep(5000);
                    }
    				return true;

    tested, works gread.

     

    Transport to Exodar from Dalaran.xml

  6. I thought id share a better, cleaner way to set HearthStone.

    var Stone = Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;");
    		if (Stone != "LocationName" && wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(x, y, z), NpcID))
    		{
    			Usefuls.SelectGossipOption(GossipOptionsType.binder);
    			Thread.Sleep(100);
    			Lua.LuaDoString("StaticPopup1Button1");
    			Lua.LuaDoString("CloseMerchant()");
    		}

     

  7. Hello, this is just thread where i post miscellaneous Code  to help others get idea or fix to there problems. Note some code works, some doesnt. its mainly for educational perspectives.

     

    Quest Checker

     private static bool IsQuestCompleted(int questID)
        {
            Lua.LuaDoString("ExpandQuestHeader(0)");
            int QuestCount = Lua.LuaDoString<int>(@"return select(1, GetNumQuestLogEntries())");
            for (int i = 1; i <= QuestCount; i++)
            {
                var QuestInfo = Lua.LuaDoString<List<string>>(string.Format(@"return GetQuestLogTitle(" + i + ")"));
    
                
                if (QuestInfo[4] == "1" || QuestInfo[5] == "1")
                    continue;
    
                string QuestStatus = null;
                if (QuestInfo[6] == "1")
                    QuestStatus = "completed";
                else if (QuestInfo[6] == "-1")
                    QuestStatus = "failed";
                else
                    QuestStatus = "in progress";
                if (QuestInfo[8] == Convert.ToString(questID) && QuestStatus == "completed")
                {
                    return true;
                }
            }
            return false;
        }

     

×
×
  • Create New...