Jump to content

Recommended Posts

how to write in C++ format the usual follow path like quester profile. I need it for create quester profile(RunCode). So the bot ran to the nearest point and not the starting point of the code. if I write this:


 

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p1);

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p2);  

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p...);

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(pN);


 

the bot will always start from the first point of the route.

In the one step I create many actions with many conditions. Goto follow path + use stealth + use item + again follow path... + ... . Me so feel more comfortable than a large number of steps in quest profile

//bad pseudo code:
bool reachedP1 = false;
if(!reachedP1)
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p1);
}
//p1 is reached here
if(ObjectManager.Me.Position.DistanceTo(p1) < 5)
{
reachedP1 = true;
}

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p2);  

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p...);

wManager.Wow.Bot.Tasks.GoToTask.ToPosition(pN);

But keep in mind, you have to do this in full C# quest. NOT just overrideCSharpPulse! Or else it will go to P1 over and over, because everytime it sets reachedP1 to false in the start.
If you want to use this in OverrideCSharpPulse, you have to use Var API, like here:

Instead of just using boolean you will do

if(Var.GetVar<bool>("reachedP1") == null)
{
  Var.SetVar("reachedP1", false);
}

if(!Var.GetVar<bool>("reachedP1"))
{
  GoToTask.ToPos(p1);
  //if close code
  Var.SetVar("reachedP1", true);
}

It's all a bit pseudo code but you get the idea

On ‎8‎/‎1‎/‎2018 at 1:09 PM, Droidz said:

why not use quest type followpath?

    var path = new List<Vector3>() {
    new Vector3(891.3235, -259.2199, -45, "None"),
    new Vector3(881.2866, -271.8759, -45, "None"),
    new Vector3(880.6079, -280.9656, -45, "None"),
    new Vector3(888.381, -293.3022, -45, "None"),
    new Vector3(890.4747, -304.1179, -45, "None"),
    };

    var min = path[0];

    for(int i = 0; i < path.Count; i++)
    {
        if(ObjectManager.Me.Position.DistanceTo(min) < ObjectManager.Me.Position.DistanceTo(path))
            min = path;
        else if(i > 0)
            path.Remove(path);
    }


    foreach(var p in path)
        wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p);

 

Bot run to 2nd point in the path.Why it don't work? Write please working code for Bot go to min distance in the path.

overrideCSharpPulse

The method inside this gets called OVER AND OVER by wRobot (basically anytime the quester pulse state is called).
If you initialize the path list inside that mehod, its state gets reset every time wRobot restarts the state...

See my explanation above

2 hours ago, Matenia said:

overrideCSharpPulse

The method inside this gets called OVER AND OVER by wRobot (basically anytime the quester pulse state is called).
If you initialize the path list inside that mehod, its state gets reset every time wRobot restarts the state...

See my explanation above

//bad pseudo code: bool reachedP1 = false; if(!reachedP1) { wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p1); } //p1 is reached here if(ObjectManager.Me.Position.DistanceTo(p1) < 5) { reachedP1 = true; } wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p2); wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p...); wManager.Wow.Bot.Tasks.GoToTask.ToPosition(pN);

If I put the pause and after start bot again running to p1 if he stay < 5 yards from p1.

Do you can write code like Droidz wrote for WRobot in Quester Follow path?

  • 9 months later...

Sorry for reviving this thread. But i've got the same problem and i'm not sure how to solve it.

I need to create a follow path analog with C#. The question is, is it possible to create an instance of QuestFollowPathClass with preset Path, IsCompleteWhenAtLastPath, and other parameters, hold it file and then just call it from the code with something like MyFollowPathQuest.Pulse() ?

Let's say even call it from the same file. It's not a library question.

15 hours ago, Findeh said:

Sorry for reviving this thread. But i've got the same problem and i'm not sure how to solve it.

I need to create a follow path analog with C#. The question is, is it possible to create an instance of QuestFollowPathClass with preset Path, IsCompleteWhenAtLastPath, and other parameters, hold it file and then just call it from the code with something like MyFollowPathQuest.Pulse() ?

Let's say even call it from the same file. It's not a library question.

Hello, yes use code like:

wManager.Wow.Helpers.Quest.QuesterCurrentContext.QuestsClasses["MyQuestClassName"].Pulse()

(replace MyQuestClassName by you quest name (name used in steps))

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