TheSmokie 242 Posted November 30, 2020 Author Share Posted November 30, 2020 first off (ive been learning frames last few days, never use a frame for buying stuff. 2nd there is no wow function itemCount Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60732 Share on other sites More sharing options...
TheSmokie 242 Posted November 30, 2020 Author Share Posted November 30, 2020 Message me your discord and i can sit down with you and help you learn, Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60733 Share on other sites More sharing options...
Sorcerer 0 Posted December 1, 2020 Share Posted December 1, 2020 Nothing wrong in using lua, if I get the food in my inventory then Tool.HasItem will find it regardless of the method I'm using to obtain it, and I think it's a very good method to obtain the item. I mean the C# for HasItem is even using lua to return item amount. The problem I'm having has nothing to do with this at all ? the bot is not even approaching the NPC to interact. The condition for NPC interaction is this: return Tool.HasItem("Graccu's Mince Meat Fruitcake") < 0; Naturally, a newly made character will fill this condition as it has none of that food. I don't understand why is the bot not moving to interact with the NPC? --- itemCount() is my own custom function, it returns how many of particular item I have in my bag. As I said, everything works flawlessly, I am not new to using LUA or making LUA functions for WoW ? -- I want to clear some confusion, my addon has Nothing to do with WRobot. It just buys me food when I right click (interact) with the NPC, the addon does this regardless whether I have WRobot running or not. It works 100% fine. All I want WRobot to do, is to right click (interact) with the NPC. When I don't have food in my inventory, which return I am trying to get with Tool.HasItem - that's really all! ? Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60736 Share on other sites More sharing options...
TheSmokie 242 Posted December 1, 2020 Author Share Posted December 1, 2020 using frames like that one is everything SINGLE TIME you try go to vender it will run, which can cause problems. use this instead, use overridepulse to go buy stuff from venders. if(wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(1,1,1), 55 , 1)) // vectors of the npc, npc ID, Gossip { Tool.BuyItem("itemName", Amount); } return true; Sorcerer 1 Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60737 Share on other sites More sharing options...
TheSmokie 242 Posted December 1, 2020 Author Share Posted December 1, 2020 or use @Droidz method - Sorcerer 1 Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60739 Share on other sites More sharing options...
Sorcerer 0 Posted December 1, 2020 Share Posted December 1, 2020 Thank you! This is exactly what I was looking to forwards ? . I took the npc coordinates and npc entry - I'm 100% sure this info is correct! When I launch bot, there is no error -- but still no moving to the npc / interacting which is the main issue. QuestType: OverridePulseCSharpCode Quest Order: ActionType: Pulse if(wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(4895.55, -2842.65 , 1442.897), 25024, 1)) // vectors of the npc, npc ID, Gossip { Vendor.BuyItem(ItemsManager.GetNameById(21215), 1); } return true; I got a error with Tool.BuyItem for some reason so I tried using the buy code from the other thread InteractWithNPC.xml Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60740 Share on other sites More sharing options...
TheSmokie 242 Posted December 1, 2020 Author Share Posted December 1, 2020 Did you turn on quest not needed in settings Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60741 Share on other sites More sharing options...
TheSmokie 242 Posted December 1, 2020 Author Share Posted December 1, 2020 Add your conditions Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-60751 Share on other sites More sharing options...
tonliol 0 Posted February 16, 2021 Share Posted February 16, 2021 How to use the code? Create the code into a plugin? Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-61266 Share on other sites More sharing options...
Sye 1 Posted April 5, 2021 Share Posted April 5, 2021 Csharp LoadProfile public class Load { public static void LoadProfile(string ProfileName) { var p = Quest.QuesterCurrentContext.Profile as QuesterProfile; if (p != null) { p.QuestsSorted.Add(new wManager.Wow.Class.QuestsSorted { Action = wManager.Wow.Class.QuestAction.LoadProfile, NameClass = ProfileName }); } } } Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-61756 Share on other sites More sharing options...
Sye 1 Posted April 13, 2021 Share Posted April 13, 2021 Use Item By Name public static void UseItemByName(string ItemName) { var useItem = string.Format(@" for bag = 0,4 do for slot = 1,GetContainerNumSlots(bag) do local item = GetContainerItemLink(bag,slot) if item and item:find('{0}') then local startTime = GetItemCooldown(GetContainerItemID(bag,slot)) if startTime <= 0 then UseItemByName('{0}') break; end end end end", ItemName); Lua.LuaDoString(useItem); } Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-61808 Share on other sites More sharing options...
Sye 1 Posted April 13, 2021 Share Posted April 13, 2021 Crafting Function with a Wait while Player is Casting. public static void Crafting(string profession, string itemName, int quantity = 0) { MovementManager.StopMoveTo(false, 1000); var ItemToCraft = Lua.LuaDoString<int>(string.Format(@" if not TradeSkillFrame or TradeSkillFrame:IsVisible() == nil then CastSpellByName('{0}') end for i=1, GetNumTradeSkills() do Quantity = {2}; local skillName, _, numAvailable = GetTradeSkillInfo(i); if (skillName == '{1}') then SelectTradeSkill(i); if Quantity == 0 then Quantity = numAvailable; end DoTradeSkill(i, Quantity); break; end end return Quantity;", profession, itemName, quantity) ); if (ItemToCraft > 0) { Logging.Write("Player is Crafting " + itemName); int Time = (3000 + Usefuls.LatencyReal) * ItemToCraft; MovementManager.StopMoveTo(false, Time); DateTime time = DateTime.Now.AddMilliseconds(Time); while (DateTime.Now < time && !ObjectManager.Me.InCombatFlagOnly && !ObjectManager.Me.InCombat) { Thread.Sleep(300); } Logging.Write("Crafting Has Came to a End."); Lua.LuaDoString("HideUIPanel(TradeSkillFrame)"); } } Link to comment https://wrobot.eu/forums/topic/12034-toolboxvanilla-wotlk-many-useful-functions-custom-script/?page=2#findComment-61813 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now