Jump to content

Force Selling before Training Spells


ScripterQQ

Recommended Posts

Hello, I'm working on a Quester Profile 1-80 that basically is a Grinder path but more accurate and with extra features.

For example, at the start of the profile, I Immediately override some wrobot settings, so each time I create a new char I don't have to mess around with switches and various options. I forced to dont attack elite, don't go at trainer (I use separate plugin for that), don't calculate range by size and similar things.

One thing I would really like to have is something that forces the bot to repair before learning new spells, because at the moment, when it triggers the "training spells" it goes straight forward to the trainer, and it doesn't have enough money.. I would prefer it goes to the nearest repair, sells all the stuff to get some money and only after that, go to learn new spells. Is it possible somehow? Thanks :wink:

 

Link to comment
Share on other sites

I'm using the plugin Trainlevel.cs (modified with the levels I want), I guess I need to write additional code in there. Or add the entire plugin inside the Quester profile, but this doesn't sound good to me honestly, because I want to have a Quester profile that works for every class, meanwhile, the Trainlevel.cs is different from class to class.

Link to comment
Share on other sites

wManager.Wow.Bot.States.ToTown.ForceToTown = true;

Forces ToTown state, going to closest vendor.
If you want this to be done before training, you can probably try 

new wManager.Wow.Bot.States.Trainers().NeedToRun

This should check if it needs to run to trainer currently. However, it's not fully reliable, rather you would need to run this:

robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
{
  if (state != null && state.GetType() == typeof(wManager.Wow.Bot.States.Trainers) && state.NeedToRun)
  {
    wManager.Wow.Bot.States.ToTown.ForceToTown = true;
  }
};

Everytime the bot checks if it needs to go trainers, you are forcing ToTown. I'm not sure if calling NeedToRun sets some timer or something else, because states aren't documented. So it's possible that this will break training entirely.
It's also possible that ToTown is checked before Trainers, in which case you would need to call cancelable.Cancel = true;  after the ForceToTown line to make it re-check if it needs to trainer later (then again, that could break training entirely).

So have fun testing or wait for Droidz to give some info.

Link to comment
Share on other sites

I didn't pay attention to ToTown... right now I'm low level and leveling below Goldshire, so when the "go to trainer" triggers, it goes up to Goldshire, but from south, so it may happen that the trainer (in my case: warrior) is closer than the repair NPC and maybe this is the reason it trains before repairing. Maybe.

I should do a test and see if approaching Goldshire from North, the bot does first repair and then Trains spells, because coming from north the repair npc is closer than the trainer.

Link to comment
Share on other sites

It doesn't care of distance. It iterates "states". It checks if each state needs to be run, if true that state is run until it is finished.
Then it continutes to the next state that needs to be run. ToTown and Trainers are 2 different states, so I was talking about priority here.

Link to comment
Share on other sites

5 minutes ago, Mike-Mail said:

Sometimes that bot bugges out and goes out to france instead of whats close, this way you can set in the profile where to go and get train + vender stuff

 

Yea I understand, I need to work on it because as already said I would like to have a Quest profile that fits all classes, but a training level profile/plugin changing from class to class (I usually do 5-10-15-20 and so on, but on certain classes I prefer to customize when to visit the trainer)

Link to comment
Share on other sites

  • 4 years later...

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