Jump to content

Recommended Posts

Hello, I've been messing with profiles and got some help form a community member, but I have a question regarding this piece of code.

 

//Start Movement
            Vector3 startPoint = new Vector3(-8863.688f, -211.7936f, 80.63557f);

            IEnumerable<Vector3> paths = new List<Vector3>() {
new Vector3(-8863.688f, -211.7936f, 80.63557f, "None"),
new Vector3(-8865.09f, -216.894f, 80.96149f, "None"),
new Vector3(-8867.372f, -223.5137f, 81.30844f, "None"),
new Vector3(-8867.26f, -229.2805f, 81.51604f, "None"),
new Vector3(-8861.448f, -232.0775f, 81.7221f, "None"),
new Vector3(-8855.631f, -228.725f, 81.67682f, "None"),
new Vector3(-8851.373f, -225.6607f, 81.73775f, "None"),
new Vector3(-8851.373f, -225.6607f, 81.73775f, "None")
                                                                };
            if (ObjectManager.Me.Position.DistanceTo2D(startPoint) < 300)
            {
                // Process waypoints
                foreach (Vector3 waypoint in paths)
                {
                    // Move to the given position
                    MovementManager.Go(PathFinder.FindPath(waypoint), false);

                    // Loop
                    while (MovementManager.InMovement && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                    {
                        // Wait follow path
                        Thread.Sleep(10);
                    }
                }

                // Stop movement
                MovementManager.StopMove();

                // End Movement

            }

It works great, only issue I have is when the bot approaches it next Vector3 it stops for a split second before preceding on. Looks abnormal and not human like. Is there a way to smooth it out? I've tried adjusting the Thread.Sleep() function with a lower number but the results are the same. Something else I've tried it running Wrobot with the No Frame Lock. 

Maybe this is a limitation to the bot or I'm simply overlooking some simple any advise or help would be greatly appreciated. 

Link to comment
https://wrobot.eu/forums/topic/9489-custom-code-movement/
Share on other sites

12 hours ago, eeny said:

Is there any reason you are using this method of movement over a followpath??

Personally I'm a fan of a followpath pulse if i know the bot is going to need something more than native navigation...

I use Followpath if the quest is a Go talk to x but I was using this code for Kill and loot or gather quests. Once completed do this code so the bot takes a predefined path and looks more normal. 

Link to comment
https://wrobot.eu/forums/topic/9489-custom-code-movement/#findComment-44089
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...