Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Herb nodes are getting ignored after unsuccessful attempt

Featured Replies

Hi,

On my plugin, i disabled combat completely with this code,

 Conditions.ForceIgnoreIsAttacked = true;

But when bot is trying to gather herb and a mob attacks it and interrupts gathering cast, bot assumes that gathering was successful and keeps move on. In real, gathering cast is interrupted and items are not looted. How can i force bot to  try gather herb again?

 

 

Hmm, I have not tested this, and it's probably more or-less pseudo code:

Will use a list of objects from WRobot Settings - List Harvest objects and while the player is more than 1 yard (Distance may need tweaking) from the nearest object,
will disable all combat until the player distance is within the 1 yard. It will allow for combat if necessary, and while the object is not null and is valid, will interact with it.

In combat, you may move a lot or a little depending on your fight class, and other plugins, so the distance will most certainly need to played with.

There may be errors here, but it's just a thought.

var objectsHarvestIds = new List<WoWGameObject>();
objectsHarvestIds.AddRange(ObjectManager.GetWoWGameObjectById(wManager.wManagerSetting.CurrentSetting.ListHarvest).OrderByDescending(o => o.GetDistance));

if (objectsHarvestIds.Count <= 0) return;

try
{
    if (objectsHarvestIds != null)
    {
        var objectToHarvest = objectsHarvestIds.Where(o => o != null && o.IsValid).OrderBy(o => ObjectManager.Me.Position.DistanceTo(o.Position)).FirstOrDefault();

        if (objectToHarvest != null && objectToHarvest.IsValid)
        {
            while (Vector3.Distance(ObjectManager.Me.Position, objectToHarvest.Position) > 1.0f)
            {
                Conditions.ForceIgnoreIsAttacked = true;
            }

            while (Vector3.Distance(ObjectManager.Me.Position, objectToHarvest.Position) <= 1.0f)
            {
                Conditions.ForceIgnoreIsAttacked = false;

                while (objectToHarvest != null && objectToHarvest.IsValid)
                {
                    Interact.InteractGameObject(objectToHarvest.GetBaseAddress);
                }
            }
        }
    }
    Conditions.ForceIgnoreIsAttacked = false;
}
catch (Exception e)
{
    Logging.WriteError("HarvestGameObject Error!" + Environment.NewLine + e);
}

 

  • Author

So, your idea is that, we have to force for gathering until we loot the herb. I thought there might be a way to manipulate harvested object list so bot would try to gather again. If it is not the case, thank you for the example code, i will try to improve it.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.