RedPia 0 Posted September 1, 2020 Share Posted September 1, 2020 Hey , I wanted to change some of my druid fightclass, so that he goes out of Catform once he tries to loot Quest items on the floor, like a piece of wood (not of kill quests). This is the code i currently use to get out of catform to farm ores. var nodesNearMe = ObjectManager.GetObjectWoWGameObject().FindAll(p => p.GetDistance <= 8 && p.CanOpen); // break bear for the nodes if (nodesNearMe.Count > 0 && !(ObjectManager.Me.InCombatFlagOnly) && ObjectManager.Me.HaveBuff("Bear Form")) { Lua.LuaDoString("CastSpellByName(\"Bear Form\",1)"); Thread.Sleep(400); } Which function could i use here so the Bot detects questitems and not nodes? greet Red Quote Link to post Share on other sites
Apexx 42 Posted September 1, 2020 Share Posted September 1, 2020 (edited) I am not quite sure if WRobot is able to distinguish between quest objects from any other game object that is interactable. You may need to make a list, or dictionary with quest id, and quest item id.. but you can just compare the nodeNearMe by the name of the object, aka Quest item. var nodeNearMe = ObjectManager.GetObjectWoWGameObject().Where(t => t != null && t.CanOpen).OrderBy(u => ObjectManager.Me.Position.DistanceTo(u.Position)).FirstOrDefault(); if (nodeNearMe != null && nodeNearMe.Name == "Quest Item Name Here" && ObjectManager.Me.Position.DistanceTo(nodeNearMe.Position) <= 8) { // break bear for the nodes if (!ObjectManager.Me.InCombatFlagOnly && ObjectManager.Me.HaveBuff("Bear Form")) { Lua.LuaDoString("CastSpellByName(\"Bear Form\",1)"); Thread.Sleep(400); } } Edited September 1, 2020 by Apexx Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.