public void EngineStop() { PullController.Stop(); Stuck.Stop(); Navigator.Stop(); Navigation = null; Navigator = null; _states = null; CombatHandler.CombatStatusChanged -= CombatChanged; GC.Collect(); }
public bool EngineStart() { GrindingSettings.LoadSettings(); if (!ObjectManager.InGame) { Logging.Write(LogType.Info, "Enter game before starting the bot"); return false; } if (ObjectManager.MyPlayer.IsDead && ObjectManager.MyPlayer.IsGhost) { Logging.Write(LogType.Info, "Please ress before starting the bot"); return false; } if (CurrentProfile == null) { Logging.Write(LogType.Info, "Please load a profile"); return false; } Navigator = new GrindingNavigator(); Navigation = new GrindingNavigation(CurrentProfile); GrindingSettings.LoadSettings(); ToTown.SetToTown(false); switch (CurrentMode) { case Mode.TestToTown: Logging.Write(LogType.Warning, "Starting Grinding engine in TestToTown mode, next start will be in normal mode THIS IS TODO"); //TODO break; default: _states = new List<MainState> { new StatePull(), new StateLoot(), new StateMoving(), new StateTrainer(), new StateResting(), new StateResurrect(), new StateCombat(), new StateToTown(), new StateVendor(), }; break; } Stuck.Run(); CurrentMode = Mode.Normal; CombatHandler.CombatStatusChanged += CombatChanged; CloseWindows(); loots = 0; _kills = 0; _death = 0; _xpInitial = ObjectManager.MyPlayer.Experience; _startTime = DateTime.Now; /* if (GrindingSettings.ShouldTrain) { ShouldTrain = GrindingShouldTrain.ShouldTrain(); }*/ PullController.Start(); return true; }