August 4, 20223 yr Hi In party product, the bot will not start regen if "ressurect when dead" is disabled thanks
August 5, 20223 yr Hello, Party bot haven't regen feature. But you can use https://wrobot.eu/files/file/650-party-chat-command/ to make the members of the group eat/drink.
August 5, 20223 yr Author with the PartyRegen pluggin party regen. but only if "resurect when dead" is enable
August 5, 20223 yr try with this code using System; using robotManager.Events; using robotManager.FiniteStateMachine; using robotManager.Helpful; using wManager.Plugin; using wManager.Wow.Bot.States; public class Main : IPlugin { private bool _stateAdded; public void Initialize() { FiniteStateMachineEvents.OnStartEngine += StateAddEventHandler; FiniteStateMachineEvents.OnAfterRunState += AfterStateAddEventHandler; } private void AfterStateAddEventHandler(Engine engine, State state) { AddState(engine); } private void StateAddEventHandler(Engine engine) { AddState(engine); } public void Dispose() { FiniteStateMachineEvents.OnStartEngine -= StateAddEventHandler; FiniteStateMachineEvents.OnAfterRunState -= AfterStateAddEventHandler; } public void Settings() { } private void AddState(Engine engine) { if (!_stateAdded && engine != null) { try { State resState = engine.States.Find(state => state.GetType() == typeof(IsAttacked)); engine.AddState(new Regeneration() {Priority = resState.Priority - 1}); engine.States.Sort(); _stateAdded = true; Logging.Write("Adding Regen State"); } catch (Exception e) { //Logging.WriteError("" + e); } } } }
June 15, 20232 yr @Droidz after this code I catch "collection was modified". Obviously due to "foreach (State state in States)" code How to add&sort states before first Pulse() of it?
June 16, 20232 yr That error happens once, in WRobot's code. Next iteration it does, it now has your states in it and everything works without error. Edit: These are 5 years old, but the code is still applicable as far as I know. No guarantee PartyBot Helper still works with HMP. Edited June 16, 20232 yr by Matenia
June 16, 20232 yr 4 hours ago, Matenia said: in WRobot's code. Sure, I even gave an example: "foreach (State state in States)". Thanks anyway
June 16, 20232 yr Look at what I linked. The error happens ONCE after you add your state. This code works fine - wRobot's FiniteStateMachine that iterates the states throws the error. Since you only modify the collection ONCE to add your state(s), the very next iteration across all states works just fine. I'm telling you, you can ignore the error.
Create an account or sign in to comment