BarryDurex
New Member
- Joined
 - Jan 20, 2010
 
- Messages
 - 361
 
- Reaction score
 - 32
 
Damn, that's harsh bro. My feelings are hurt.
Oh yes, big sorry!
I forget to mention you..
So, special thanks to mastahg, too!
Damn, that's harsh bro. My feelings are hurt.
        public override void Pulse()
        {
            if (!isInitialize) { updateList(true); isInitialize = true; }
            while (!complete && !Me.Combat)
            {
                ObjectManager.Update();
                List<WoWGameObject> _ObjList = ObjectManager.GetObjectsOfType<WoWGameObject>();
                double xyDist = double.MaxValue;
                WoWGameObject bestNode = null;
                List<WoWGameObject> bestNodes = new List<WoWGameObject>(5);
                if (StyxWoW.Me.Inventory.Equipped.OffHand != null && ((StyxWoW.Me.Inventory.Equipped.OffHand.ItemInfo.Id == 45067 || StyxWoW.Me.Inventory.Equipped.OffHand.ItemInfo.Id == 44802) && StyxWoW.Me.Inventory.Equipped.OffHand.Cooldown <= 0))
                {
                    Logging.Write("EGG RUSH!");
                    StyxWoW.Me.Inventory.Equipped.OffHand.Use();
                }
                //int i = 0;
                //foreach (WoWGameObject obj in _ObjList)
                //for (int i = _ObjList.Count - 1; i >= 0; i--)
                //{
                //    slog("search for best node");
                //    TreeRoot.StatusText = Name + ": search for best node";
                //    if (_ObjList[i].Entry != (uint)113768)
                //    {
                //        _ObjList.Remove(_ObjList[i]);
                //        continue;
                //    }
                //}
                int i = 0;
                while (i <= _ObjList.Count && bestNodes.Count < 5)
                {
                    foreach (WoWGameObject egg in _ObjList)
                    {
                        ++i;
                        slog("search for best node");
                        TreeRoot.StatusText = Name + ": search for best node";
                        if (egg.Entry == 113768 && egg.CanUse() ||
                            (egg.Entry == 113769 && egg.CanUse()) ||
                            (egg.Entry == 113770 && egg.CanUse()) ||
                            (egg.Entry == 113771 && egg.CanUse()))
                        {
                            double dist = egg.Distance2D;
                            if (xyDist > dist)
                            {
                                if (dist < 100)
                                {
                                    xyDist = dist;
                                    bestNodes.Add(egg);
                                    //bestNode = egg;
                                }
                            }
                        }
                        continue;
                    }
                }
                //if (bestNode != null) { slog("GuID: " + bestNode.Guid + " Distance: " + (int)bestNode.Distance); }
                //slog("found " + bestNode.Name + " Distance: " + (int)bestNode.Distance + "yards");
                //slog(bestNode.ToString());
                //TreeRoot.StatusText = Name + ": found: [" + bestNode.Name + "] Distance: " + (int)bestNode.Distance + "yards";
                //achievementFound = true;
                if (bestNodes.Count > 1)
                {
                    Random random = new Random();
                    int index = random.Next(0, (bestNodes.Count - 1)); // bestNodes.Count for List<WoWGameObject> 
                    bestNode = bestNodes[index];
                }
                else
                {
                    bestNode = bestNodes[0];
                }
                while (searchEgg == false && bestNode != null && bestNode.Location != WoWPoint.Empty && bestNode.CanUse() && !bestNode.CanUseNow())
                {
                    slog("Move to " + bestNode.Name);
                    TreeRoot.StatusText = Name + ": Move to " + bestNode.Name + " Distance: " + (int)Me.Location.Distance(bestNode.Location) + "yards";
                    Navigator.MoveTo(bestNode.Location);
                    Thread.Sleep(100);
                    CheckInventoryItems();
                }
                Navigator.MoveTo(Me.Location);
                //WoWMovement.MoveStop();
                while (bestNode != null && bestNode.IsValid /* && bestNode.Distance <= 5*/ && stuckTimer.ElapsedMilliseconds <= 2000 && bestNode.CanUseNow())
                {
                    stuckTimer.Start();
                    WoWMovement.MoveStop();
                    //if (bestNode != null) slog("Interact..");
                    TreeRoot.StatusText = Name + ": Interact..";
                    slog("looting..");
                    bestNode.Interact();
                    //Thread.Sleep(3000);
                    while (LootFrame.Instance.IsVisible)
                    {
                        TreeRoot.StatusText = Name + ": looting..";
                        if (LootFrame.Instance.IsVisible)
                        {
                            Lua.DoString("for i=1,GetNumLootItems() do ConfirmLootSlot(i) LootSlot(i) end");
                            break;
                        }
                        bestNode = null;
                        Thread.Sleep(1500);
                    }
                }
                stuckTimer.Stop(); stuckTimer.Reset();
            }
        }
	good idea, I'll add itIf more then one bot of this is running at the same location, it ends up in an egg race. Maybe you should choose a random egg out of the three or five "best ones".
I have not tested but it should workthis work for horde?
good idea, I'll add it
** UPDATE **
to v1.1.1
yes, I already had to delete hundreds of eggs to make room..Yep, it's less detectable and running well for my two druids in travel form while writing this ^^
yes, I already had to delete hundreds of eggs to make room..
i have add your last code but for me does not work.. (v1.1.2)
if (StyxWoW.Me.Inventory.Equipped.OffHand == null || (StyxWoW.Me.Inventory.Equipped.OffHand.ItemInfo.Id != 45067 || StyxWoW.Me.Inventory.Equipped.OffHand.ItemInfo.Id != 44802))
	Have you selected AutoLoot in the wow settings?Do you have to be a certain level? I tried a lvl 6 and it wont work although I can see the eggs myself and interact with them.
I also tried as per the instructions and it did not work.
Do we need to not load a blank profile anymore?
Is there a specific version of HB were supposed to be using. (downloaded the latest version didnt work)
Do you want a log to see maybe why it went wrong?
yes the maillboxs are problems, maybe it works if you add the mailbox as a blackspot in your profil.Great plugin, trying this out in dolanaar (night elf area) and it works great but it does get stuck on the mailbox once in a while. Otherwise, fantastic work.
an update is coming soon, maybe even in this half-hourI can not get this to work
[8:10:34 PM:343] System.NullReferenceException: Object reference not set to an instance of an object.
at NobleGardenerAchievement.NobleGardenerAchievement.Pulse() in c:\\Honorbuddy_2.0.0.4492\Plugins\NobleGardener.cs:line 115
at Styx.Plugins.PluginWrapper.Pulse()
[8:10:34 PM:890] Plugin [Noble Gardener] threw an exception in 'Pulse'! Exception:
[8:10:34 PM:890] System.NullReferenceException: Object reference not set to an instance of an object.
at NobleGardenerAchievement.NobleGardenerAchievement.Pulse() in c:\\Honorbuddy_2.0.0.4492\Plugins\NobleGardener_v1.1.2.cs:line 126
Thats it.
Thank you, but rich you as a man not 2!haha i love this plugin so many eggs!






