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.

MovementManager.Go

Featured Replies

Hello, I need a little help. 

How can I make this function to use pathfinder to find the first/nearest position in the list of vector3? Because it goes in a straight line at start, and only use pathfinder after getting stuck. I would like to make a search path for the required NPC in the override quest type, and then interact with it when it appears, but the bot goes to this path in a straight line through sea.

 

var path = new List<Vector3>() {
new Vector3(134.4189f, -4571.758f, 268.0376f, "None"),
new Vector3(146.1211f, -4538.368f, 261.461f, "None"),
new Vector3(150.3505f, -4503.114f, 256.2892f, "None"),
new Vector3(146.0072f, -4467.485f, 253.9808f, "None"),
new Vector3(139.8191f, -4433.039f, 254.3852f, "None"),
new Vector3(140.4656f, -4397.381f, 255.7277f, "None"),
new Vector3(151.0651f, -4363.204f, 256.8899f, "None"),
new Vector3(163.2112f, -4330.521f, 257.0603f, "None"),
new Vector3(180.1993f, -4299.34f, 251.8035f, "None"),
new Vector3(207.5983f, -4277.318f, 248.4619f, "None"),
new Vector3(240.8512f, -4264.621f, 249.7808f, "None"),
new Vector3(268.6209f, -4242.891f, 251.4492f, "None"),
new Vector3(289.0244f, -4213.805f, 253.3416f, "None"),
new Vector3(309.0491f, -4184.992f, 257.0113f, "None"),
new Vector3(336.7352f, -4162.454f, 259.8828f, "None"),
new Vector3(369.5115f, -4150.962f, 256.6224f, "None"),
new Vector3(404.9132f, -4145.873f, 253.9392f, "None"),
new Vector3(438.0468f, -4133.036f, 250.3237f, "None"),
new Vector3(467.8514f, -4115.109f, 247.1384f, "None"),
new Vector3(495.5876f, -4100.673f, 245.6649f, "None"),
};

MovementManager.Go(path);
//MovementManager.GoLoop(path);


image.thumb.png.274a302f40e55f6e4a9a6dd4ba708757.png

 

If you want to move to the first spot on the list, use

GoToTask.ToPosition(path[0]);

If you want to find nearest spot on the list, you can do it this way:

using System.Linq;

List<Vector3> closestSpots = path
	.OrderBy(spot => spot.Position.DistanceTo(ObjectManager.Me.Position))
	.ToList();

Vector3 closestSpot = closestSpots[0];

I haven't tested it and there's probably a more efficient way to do it, but that should work.

  • Author

Hmm, this is a good option, thanks for the tip.

GoToTask.ToPosition(path[0]);
MovementManager.Go(path);

Should work like a loop to find npc.

Hey @pudge, i did something like this a long time ago, I've found it to be be to long, and it would slow down quester because loading all the vectors then move too. idk could be because i had it very long or somewhat. but you wanna make the MovementManager.go into a while loop. so it keeps moving.

  • Author
44 minutes ago, TheSmokie said:

Hey @pudge, i did something like this a long time ago, I've found it to be be to long, and it would slow down quester because loading all the vectors then move too. idk could be because i had it very long or somewhat. but you wanna make the MovementManager.go into a while loop. so it keeps moving.

 

I don't know how it will be work, I haven't tested it yet, code looks like this:

        var anton = ObjectManager.GetObjectWoWUnit().FirstOrDefault(g => g.Entry == 24291);

        if (anton == null)
        {
            Lua.LuaDoString("print('searching for npc')");
            wManager.Wow.Bot.Tasks.GoToTask.ToPosition(path[0]);
            MovementManager.Go(path);
        }

        if (anton != null)
        {
          
          if (Is.In path) // checking if it moves in "path" need to do
          {
          MovementManager.StopMove();
          }
          
            Lua.LuaDoString("print('npc founded')");
            if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(anton.Position), anton.Entry))
            {
                wManager.Wow.Helpers.Vendor.BuyItem("Fresh Pound of Flesh", 1);
                Thread.Sleep(3000);
            }
        }

 

As I understand it, I need to add another check that will check it is in the "path", and stop movement?
How can i do this?
if (Is.In path)
{
MovementManager.StopMove();
}

Your using 2 go to spot, i think this will cause problems, use something like this

pathToFollow = PathFinder.FindPath(new Vector3(-5814.899, 650.6406, 94.55161));

but set it to find the npc vectors.

 

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.