Jump to content

Recommended Posts

Basicly currently the problem is that it follows tank in combat and all if going too far doing fine but if tank goes out of line of sight (behind tree, hill or something) it'll just stand there like mushroom in shit. Any ideas how to improve this? For some reason with MovementManager.MoveTo(tank) it requires straight line to the target without anything on its way

 

        #region Tank too far
        bool tankfar()
        {
            WoWPlayer tank = getTanks().First();
            while (tank.GetDistance > 15)
            {
                MovementManager.MoveTo(tank);
            }
            MovementManager.StopMove();
            return false;
        }
        #endregion

 

Link to comment
https://wrobot.eu/forums/topic/2675-improving-tanktoofar/
Share on other sites

Hello,

To stop to go to tank if it is out of view you can use this code:

        #region Tank too far
        bool tankfar()
        {
            WoWPlayer tank = getTanks().First();
            while (tank.IsValid && tank.GetDistance > 15 && !wManager.Wow.Helpers.TraceLine.TraceLineGo(tank.Position))
            {
				MovementManager.MoveTo(tank);
				System.Threading.Thread.Sleep(50);
            }
            MovementManager.StopMove();
            return false;
        }
        #endregion

 

To generate path and go to tank you can use code like this:

        #region Tank too far
        bool tankfar()
        {
            WoWPlayer tank = getTanks().First();
            if (tank.IsValid && tank.GetDistance > 15)
            {
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWith(new WoWUnit(tank.GetBaseAddress), -1, false, context => Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && tank.GetDistance > 15);
            }
            MovementManager.StopMove();
            return false;
        }
        #endregion

 

Link to comment
https://wrobot.eu/forums/topic/2675-improving-tanktoofar/#findComment-12216
Share on other sites

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...