Matenia 629 Posted November 22, 2017 Share Posted November 22, 2017 I looked into the Trainers state, but it's highly obfuscated. I know the TrainLevel plugin that just keeps overwriting the wRobot setting, but sometimes it misses out and then you have to wait for 6 levels, so I'm not happy with that. So I have tried this code, but it doesn't exactly work either. Can you maybe give some more info @Droidz? public static void Start() { FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += TrainingEventHandler; } public static void Stop() { FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState -= TrainingEventHandler; } private static void TrainingEventHandler(robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable) { if (state.GetType() == typeof(Trainers)) { bool hasToTrain = LevelsToTrain.Contains(ObjectManager.Me.Level); Logging.WriteDebug("Checking if we have to go to trainer: " + (hasToTrain ? "yes" : "no")); if (!hasToTrain) { cancelable.Cancel = true; } } } Link to comment https://wrobot.eu/forums/topic/7776-how-does-the-bot-decide-to-train-new-spells/ Share on other sites More sharing options...
Droidz 2739 Posted November 22, 2017 Share Posted November 22, 2017 Hello, your code seem good, check if you haven't another plugins activated (check also if without this plugin wrobot go to trainer to check your trainer settings) Link to comment https://wrobot.eu/forums/topic/7776-how-does-the-bot-decide-to-train-new-spells/#findComment-35578 Share on other sites More sharing options...
Matenia 629 Posted November 22, 2017 Author Share Posted November 22, 2017 I think it was missing trainers in the database for some reason. I added some more and it seemed to work then, thanks. Link to comment https://wrobot.eu/forums/topic/7776-how-does-the-bot-decide-to-train-new-spells/#findComment-35579 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now