Jump to content

Few developer questions.


Zoki

Recommended Posts

Hey there.
I'm relatively new to WRobot, so far I'm learning plugin writing so I can have full control on most of bot's actions.
I'd like to know if there is a way to recompile plugins without reopening Wrobot every time.
Is there a way to block Product (like Gatherer or Quester) pulsing so plugin could take needed actions?
Thanks in advance <3

Link to comment
Share on other sites

Hello and welcome to the Wrobot community!

Usually you don't need to reopen Wrobot to compile the plugins(only if you add a new .cs or .dll file to the plugin directory). As soon you save the .cs or .dll file you just need to start and stop Wrobot to update it.

And yes, you can block your product indirectly by events.

 

For e.g. the movement

    public Vector3 POI = new Vector3();

    public void Initialize()//wrobot method
    {
        MovementEvents.OnMoveToPulse += (vectors, state) =>
        {
            if (POI != Vector3.Empty && MovementManager.CurrentPath.LastOrDefault() != POI)
            {
                state.Cancel = true;
            }
        };
    }

    public void Pulse()//ticks
    {
        if (ObjectManager.Me.TargetObject.Position != Vector3.Empty && POI == Vector3.Empty && POI.DistanceTo(ObjectManager.Me.Position) > 5)
        {
            List<Vector3> Path = PathFinder.FindPath(ObjectManager.Me.Position, ObjectManager.Me.TargetObject.Position);
            MovementManager.Go(Path);
            POI = Path.LastOrDefault();
            Logging.Write("Walk to :\n"+POI);
        }
        if (!ObjectManager.Me.GetMove && POI != Vector3.Empty)
        {
            List<Vector3> Path = PathFinder.FindPath(ObjectManager.Me.Position, POI);
            MovementManager.Go(Path);
        }
        else if (POI.DistanceTo(ObjectManager.Me.Position) < 7)
        {
            Logging.Write("Arrived clear target to go back to task");
            Lua.LuaDoString("ClearTarget()");
        }
        if (ObjectManager.Me.Target == 0)
        {
            POI = new Vector3();
        }
    }

 

or you switch your product which doesn't influence specific behaviors:

 

Link to comment
Share on other sites

Products.ProductStop();
Products.LoadProducts(name);

For changing between Quester and others. If you look at available functions in the .dll files, you'll find how to load a certain quester profile too, I'm sure.

As for stopping combat:

wManager.Wow.Helpers.Fight.StopFight();

 

Link to comment
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...