March 25, 20188 yr Hello, bool added = false; robotManager.FiniteStateMachine.State myState = null; // ... robotManager.Events.FiniteStateMachineEvents.OnAddState += delegate (robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable) { if (added) return; if (state.DisplayName == "Quester") { added = true; state.NextStates.Add(myState); //engine.AddState(myState); //state.BeforeStates.Add(myState); } };
March 26, 20188 yr Author Can you add any working example? My code either produces errors or the state does nothing. Can you also add functions to the bot? Me.SubZoneId == 111 ItemsManager.UseItem() - by WoWItem, not entry Item.UseContainerItem WoWGameObject.InteractDistance WoWGameObject.IsGoodInteractDistance Me.GetAllAuras().Any(a => (a.Spell.Mechanic == WoWSpellMechanic.Stunned || a.Spell.Mechanic == WoWSpellMechanic.Fleeing || a.Spell.Mechanic == WoWSpellMechanic.Asleep || a.Spell.Mechanic == WoWSpellMechanic.Charmed) && a.IsActive && a.TimeLeft.TotalSeconds >= 2)) and fix this wManager.Wow.Helpers.Bag.PickupContainerItem - just does not work. wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWith(WoWGameObject) - goes to the object and does not interact, with npc works fine.
March 29, 20188 yr You can try bool added = false; robotManager.FiniteStateMachine.State myState = null; // ... robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += delegate (robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable) { if (added) return; if (state.DisplayName == "Quester") { added = true; state.NextStates.Add(myState); //engine.AddState(myState); //state.BeforeStates.Add(myState); } }; (replace "null" line 2 by your state instance)
March 29, 20188 yr Author I already tried it. My state, after adding, the text should be spammed. But there is nothing public class TestState : robotManager.FiniteStateMachine.State { public override string DisplayName { get { return "TestState"; } } public override int Priority { get { return priority; } set { priority = value; } } private int priority; public override bool NeedToRun { get { if (!Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause || Conditions.IsAttackedAndCannotIgnore) return false; return true; } } public override List<robotManager.FiniteStateMachine.State> NextStates { get { return new List<robotManager.FiniteStateMachine.State>(); } } public override List<robotManager.FiniteStateMachine.State> BeforeStates { get { return new List<robotManager.FiniteStateMachine.State>(); } } public override void Run() { Logging.Write("TestState", Logging.LogType.Normal, System.Drawing.Color.BlueViolet); } }
Create an account or sign in to comment