Jump to content

Recommended Posts

  • 4 weeks later...
On 18/10/2016 at 3:57 PM, Droidz said:

Hello, use grinder product and add fox id in the list of mob to attack (in grinder product wrobot gather also nodes).

The fox is not supposed to be attacked, just followed.

Link to comment
https://wrobot.eu/forums/topic/3905-hightmountain-foxflower/#findComment-19400
Share on other sites

  • 2 weeks later...
  • 3 months later...

Hello, try this plugin: FoxFlowerGatherer.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using robotManager.Helpful;
using wManager.Wow.Bot.Tasks;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public class Main : wManager.Plugin.IPlugin
{
    private bool FoxFlower()
    {
        WoWAreaTrigger scrap = GetFlowerScrap();
        if (scrap != null && scrap.IsValid)
        {
            GoToTask.ToPosition(scrap.Position);
            return true;
        }
        if (IsFoxPresent())
        {
            return true;
        }
        return false;
    }

    private bool IsFoxPresent()
    {
        IEnumerable<WoWUnit> mobsOfInterestQuery =
            from wowUnit in ObjectManager.GetObjectWoWUnit()
            where
                wowUnit.Entry == 98235
                && wowUnit.IsAlive
                && ObjectManager.GetObjectWoWPlayer().All(p => p.IsLocalPlayer || p.Target != wowUnit.Guid)
            orderby
                  wowUnit.GetDistance
            select
                  wowUnit;
        return mobsOfInterestQuery.ToList().Count() > 0;
    }

    private WoWAreaTrigger GetFlowerScrap()
    {
        IEnumerable<WoWAreaTrigger> t =
        from trigger in ObjectManager.GetObjectWoWAreaTrigger()
        where
            trigger.Entry == 9756
        orderby
            trigger.GetDistance
        select
            trigger;

        return t.FirstOrDefault();
    }

    public void Initialize()
    {
        Logging.Write("[FoxFlowerGatherer] Starting");
        robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
        {
            try
            {
                if (state != null && state.DisplayName == "Farming" &&
                    Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                {
                    while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && 
                           !Conditions.IsAttackedAndCannotIgnore &&
                            FoxFlower())
                    {
                        cancelable.Cancel = true;
                        Thread.Sleep(50);
                    }
                }
            }
            catch (Exception l)
            {
                Logging.WriteError("[FoxFlowerGatherer] " + l);
            }
        };
    }

    public void Dispose()
    {
    }

    public void Settings()
    {
    }
}

 

Link to comment
https://wrobot.eu/forums/topic/3905-hightmountain-foxflower/#findComment-23619
Share on other sites

  • 2 weeks later...

I cant seem to get this plugin to work with following the fox, are there any other settings that need to be changed?

Every time a fox spawns it will stop but it doesn't pick up the flowers but once I manually pick up them it mounts and continues the profile.

Link to comment
https://wrobot.eu/forums/topic/3905-hightmountain-foxflower/#findComment-23934
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...