Beispiel #1
0
 public override void DoWork()
 {
     GrindingEngine.Navigator.Stop();
     MoveHelper.MoveToLoc(_npc.Location, 5);
     VendorManager.DoSell(_npc);
     Logging.Write("[Vendor]Vendor done");
     GrindingEngine.Navigator.Stop();
     GrindingEngine.Navigation = new GrindingNavigation(GrindingEngine.CurrentProfile);
     ToTown.SetToTown(false);
 }
Beispiel #2
0
        public bool EngineStart()
        {
            FindNode.LoadHarvest();
            FlyingSettings.LoadSettings();
            KeyHelper.AddKey("FMount", "None", FlyingSettings.FlyingMountBar, FlyingSettings.FlyingMountKey);
            KeyHelper.AddKey("Lure", "None", FlyingSettings.LureBar, FlyingSettings.LureKey);
            KeyHelper.AddKey("Waterwalk", "None", FlyingSettings.WaterwalkBar, FlyingSettings.WaterwalkKey);
            KeyHelper.AddKey("CombatStart", "None", FlyingSettings.ExtraBar, FlyingSettings.ExtraKey);
            if (!ObjectManager.InGame)
            {
                Logging.Write(LogType.Info, "Enter game before starting the bot");
                return(false);
            }
            if (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);
            }
            if (CurrentProfile.WaypointsNormal.Count < 2)
            {
                Logging.Write(LogType.Info, "Profile should have more than 2 waypoints");
                return(false);
            }
            Navigation = new FlyingNavigation(CurrentProfile.WaypointsNormal, true, FlyingWaypointsType.Normal);
            Navigator  = new FlyingNavigator();
            ToTown.SetToTown(false);
            switch (CurrentMode)
            {
            case Mode.Normal:
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateGather(),
                    new StateCombat(),
                    new StateRess(),
                    new StateResting(),
                    new StateMailbox(),
                    new StateToTown(),
                    new StateVendor(),
                    new StateFullBags(),
                };
                break;

            case Mode.TestNormal:
                Logging.Write(LogType.Warning,
                              "Starting flying engine in TestNormal mode, next start will be in normal mode");
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateFullBags(),
                };
                break;

            case Mode.TestToTown:
                Logging.Write(LogType.Warning,
                              "Starting flying engine in TestToTown mode, next start will be in normal mode");
                FlyingStates = new List <MainState>
                {
                    new StateMount(),
                    new StateMoving(),
                    new StateCombat(),
                    new StateMailbox(),
                    new StateToTown(),
                    new StateVendor(),
                    new StateFullBags(),
                };
                ToTown.SetToTown(true);     //Set town mode to true
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            Stuck.Run();
            FlyingBlackList.Load();
            CloseWindows();
            CurrentMode = Mode.Normal;
            _harvest    = 0;
            _kills      = 0;
            _death      = 0;
            _startTime  = DateTime.Now;
            UpdateStats(0, 0, 0);
            return(true);
        }
Beispiel #3
0
        public bool EngineStart()
        {
            GrindingSettings.LoadSettings();
            if (!ObjectManager.InGame)
            {
                Logging.Write(LogType.Info, "【地面战斗】先登录游戏");
                return(false);
            }
            if (ObjectManager.MyPlayer.IsDead && ObjectManager.MyPlayer.IsGhost)
            {
                Logging.Write(LogType.Info, "【地面战斗】先复活吧");
                return(false);
            }
            if (CurrentProfile == null)
            {
                Logging.Write(LogType.Info, "【地面战斗】先读取一个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);
        }