Beispiel #1
0
        //DateTime _nextAction = DateTime.Now;
        public CombatHelperBehavior()
        {
            _lastPulse = DateTime.MinValue;
            _random = new Random();
            _salvage = new Salvage();
            _combat = new Combat();
            _drones = new Drones();
            _traveler = new Traveler();
            _unloadLoot = new UnloadLoot();
            _arm = new Arm();
            _panic = new Panic();
            _watch = new Stopwatch();

            //
            // this is combat mission specific and needs to be generalized
            //
            Settings.Instance.SettingsLoaded += SettingsLoaded;
            //Settings.Instance.UseFittingManager = false;

            // States.CurrentCombatHelperBehaviorState fixed on ExecuteMission
            _States.CurrentCombatHelperBehaviorState = CombatHelperBehaviorState.Idle;
            _States.CurrentArmState = ArmState.Idle;
            //_States.CurrentCombatState = CombatState.Idle;
            //_States.CurrentDroneState = DroneState.Idle;
            _States.CurrentUnloadLootState = UnloadLootState.Idle;
            _States.CurrentTravelerState = TravelerState.Idle;
        }
        public CombatMissionsBehavior()
        {
            _lastPulse = DateTime.MinValue;

            _traveler = new Traveler();
            _random = new Random();
            _salvage = new Salvage();
            _combat = new Combat();
            _drones = new Drones();
            _unloadLoot = new UnloadLoot();
            _agentInteraction = new AgentInteraction();
            _arm = new Arm();
            _courierMissionCtrl = new CourierMissionCtrl();
            _switchShip = new SwitchShip();
            _combatMissionCtrl = new CombatMissionCtrl();
            _panic = new Panic();
            _storyline = new Storyline();
            _statistics = new Statistics();
            _watch = new Stopwatch();

            //
            // this is combat mission specific and needs to be generalized
            //
            Settings.Instance.SettingsLoaded += SettingsLoaded;

            // States.CurrentCombatMissionBehaviorState fixed on ExecuteMission
            _States.CurrentCombatMissionBehaviorState = CombatMissionsBehaviorState.Idle;
            _States.CurrentArmState = ArmState.Idle;
            _States.CurrentUnloadLootState = UnloadLootState.Idle;
            _States.CurrentTravelerState = TravelerState.AtDestination;
        }
Beispiel #3
0
        private static void Main(string[] args)
        {
            Logging.Log("GoToBM","Started",Logging.white);
            if (args.Length == 0 || args[0].Length < 1)
            {
                Logging.Log("GoToBM"," You need to supply a bookmark name",Logging.white);
                Logging.Log("GoToBM"," Ended",Logging.white);
                return;
            }
            _BM = args[0];
            _BM = _BM.ToLower();

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;
            _directEve.OnFrame += OnFrame;
            _traveler = new Traveler();
            _cleanup = new Cleanup();
            _defense = new Defense();

            while (!_done)
            {
                System.Threading.Thread.Sleep(50);
            }

            _directEve.Dispose();
            Logging.Log("GoToBM"," Exiting",Logging.white);
            return;
        }
        //DateTime _nextAction = DateTime.Now;
        public DedicatedBookmarkSalvagerBehavior()
        {
            _lastPulse = DateTime.Now;

            //_random = new Random();
            _salvage = new Salvage();
            _localWatch = new LocalWatch();
            //_combat = new Combat();
            //_drones = new Drones();
            _traveler = new Traveler();
            _unloadLoot = new UnloadLoot();
            _arm = new Arm();
            _panic = new Panic();
            _statistics = new Statistics();
            _watch = new Stopwatch();

            //
            // this is combat mission specific and needs to be generalized
            //
            Settings.Instance.SettingsLoaded += SettingsLoaded;

            _States.CurrentDedicatedBookmarkSalvagerBehaviorState = DedicatedBookmarkSalvagerBehaviorState.Idle;
            _States.CurrentArmState = ArmState.Idle;
            //_States.CurrentDroneState = DroneState.Idle;
            _States.CurrentUnloadLootState = UnloadLootState.Idle;
            _States.CurrentTravelerState = TravelerState.Idle;
        }
 /// <summary>
 ///   Arm does nothing but get into a (assembled) shuttle
 /// </summary>
 /// <returns></returns>
 ///
 public CourierMissionCtrl()
 {
     _traveler = new Traveler();
     _agentInteraction = new AgentInteraction();
 }
Beispiel #6
0
 /// <summary>
 ///   Arm does nothing but get into a (assembled) shuttle
 /// </summary>
 /// <returns></returns>
 ///
 public CourierMissionCtrl()
 {
     _traveler = new Traveler();
 }
Beispiel #7
0
        public static void TravelToHomeBookmark(DirectBookmark myHomeBookmark, string module)
        {
            //
            // defending yourself is more important that the traveling part... so it comes first.
            //
            if (Cache.Instance.InSpace && Settings.Instance.DefendWhileTraveling)
            {
                if (!Cache.Instance.ActiveShip.Entity.IsCloaked || (Cache.Instance.LastSessionChange.AddSeconds(60) > DateTime.UtcNow))
                {
                    if (Settings.Instance.DebugGotobase)
                    {
                        Logging.Log(module, "TravelToAgentsStation: _combat.ProcessState()", Logging.White);
                    }
                    Combat.ProcessState();
                    if (!Cache.Instance.TargetedBy.Any(t => t.IsWarpScramblingMe))
                    {
                        if (Settings.Instance.DebugGotobase)
                        {
                            Logging.Log(module, "TravelToAgentsStation: we are not scrambled - pulling drones.", Logging.White);
                        }
                        Cache.Instance.IsMissionPocketDone = true; //tells drones.cs that we can pull drones

                        //Logging.Log("CombatmissionBehavior","TravelToAgentStation: not pointed",Logging.White);
                    }
                    else if (Cache.Instance.TargetedBy.Any(t => t.IsWarpScramblingMe))
                    {
                        Cache.Instance.IsMissionPocketDone = false;
                        if (Settings.Instance.DebugGotobase)
                        {
                            Logging.Log(module, "TravelToAgentsStation: we are scrambled", Logging.Teal);
                        }
                        Drones.ProcessState();
                        return;
                    }
                }
            }

            if (Settings.Instance.SpeedTank)
            {
                Cache.Instance.OpenWrecks = false;
            }

            /*
             * if (Settings.Instance.setEveClientDestinationWhenTraveling) //sets destination to Questors destination, so they match... (defaults to false, needs testing again and probably needs to be exposed as a setting)
             * {
             *  if (DateTime.UtcNow > _nextGetDestinationPath || EVENavdestination == null)
             *  {
             *      if (Settings.Instance.DebugGotobase) Logging.Log(module, "TravelToAgentsStation: EVENavdestination = Cache.Instance.DirectEve.Navigation.GetDestinationPath();", Logging.White);
             *      _nextGetDestinationPath = DateTime.UtcNow.AddSeconds(20);
             *      _nextSetEVENavDestination = DateTime.UtcNow.AddSeconds(4);
             *      EVENavdestination = Cache.Instance.DirectEve.Navigation.GetDestinationPath();
             *      if (Settings.Instance.DebugGotobase) if (EVENavdestination != null) Logging.Log(module, "TravelToAgentsStation: Cache.Instance.DirectEve.Navigation.GetLocation(EVENavdestination.Last()).LocationId [" + Cache.Instance.DirectEve.Navigation.GetLocation(EVENavdestination.Last()).LocationId + "]", Logging.White);
             *      return;
             *  }
             *
             *  if (Cache.Instance.DirectEve.Navigation.GetLocation(EVENavdestination.Last()).LocationId != Cache.Instance.AgentSolarSystemID)
             *  {
             *      //Logging.Log("CombatMissionsBehavior", "TravelToAgentsStation: Cache.Instance.DirectEve.Navigation.GetLocation(EVENavdestination.Last()).LocationId [" + Cache.Instance.DirectEve.Navigation.GetLocation(EVENavdestination.Last()).LocationId + "]", Logging.White);
             *      //Logging.Log("CombatMissionsBehavior", "TravelToAgentsStation: EVENavdestination.LastOrDefault() [" + EVENavdestination.LastOrDefault() + "]", Logging.White);
             *      //Logging.Log("CombatMissionsBehavior", "TravelToAgentsStation: Cache.Instance.AgentSolarSystemID [" + Cache.Instance.AgentSolarSystemID + "]", Logging.White);
             *      if (DateTime.UtcNow > _nextSetEVENavDestination)
             *      {
             *          if (Settings.Instance.DebugGotobase) Logging.Log(module, "TravelToAgentsStation: Cache.Instance.DirectEve.Navigation.SetDestination(Cache.Instance.AgentStationId);", Logging.White);
             *          _nextSetEVENavDestination = DateTime.UtcNow.AddSeconds(7);
             *          Cache.Instance.DirectEve.Navigation.SetDestination(Cache.Instance.AgentStationID);
             *          Logging.Log(module, "Setting Destination to [" + Cache.Instance.AgentStationName + "'s] Station", Logging.White);
             *          return;
             *      }
             *  }
             *  else if (EVENavdestination != null || EVENavdestination.Count != 0)
             *  {
             *      if (EVENavdestination.Count == 1 && EVENavdestination.FirstOrDefault() == 0)
             *          EVENavdestination[0] = Cache.Instance.DirectEve.Session.SolarSystemId ?? -1;
             *  }
             * }
             */

            if (Settings.Instance.DebugGotobase)
            {
                Logging.Log(module, "TravelToAgentsStation:      Cache.Instance.AgentStationId [" + Cache.Instance.AgentStationID + "]", Logging.White);
            }
            if (Settings.Instance.DebugGotobase)
            {
                Logging.Log(module, "TravelToAgentsStation:  Cache.Instance.AgentSolarSystemId [" + Cache.Instance.AgentSolarSystemID + "]", Logging.White);
            }

            if (_destination == null || _destination.SolarSystemId != Cache.Instance.AgentSolarSystemID)
            {
                Logging.Log(module, "Destination: [" + Cache.Instance.AgentStationName + "]", Logging.White);
                _destination = new StationDestination(Cache.Instance.AgentSolarSystemID, Cache.Instance.AgentStationID, Cache.Instance.AgentStationName);
                _States.CurrentTravelerState = TravelerState.Idle;
                return;
            }
            else
            {
                if (Settings.Instance.DebugGotobase)
                {
                    if (Traveler.Destination != null)
                    {
                        Logging.Log("CombatMissionsBehavior", "TravelToAgentsStation: Traveler.Destination.SolarSystemId [" + Traveler.Destination.SolarSystemId + "]", Logging.White);
                    }
                }
                Traveler.ProcessState();

                //we also assume you are connected during a manual set of questor into travel mode (safe assumption considering someone is at the kb)
                Cache.Instance.LastKnownGoodConnectedTime = DateTime.UtcNow;
                Cache.Instance.MyWalletBalance            = Cache.Instance.DirectEve.Me.Wealth;

                if (_States.CurrentTravelerState == TravelerState.AtDestination)
                {
                    if (_States.CurrentCombatMissionCtrlState == CombatMissionCtrlState.Error)
                    {
                        Logging.Log(module, "an error has occurred", Logging.White);
                        if (_States.CurrentCombatMissionBehaviorState == CombatMissionsBehaviorState.Traveler)
                        {
                            _States.CurrentCombatMissionBehaviorState = CombatMissionsBehaviorState.Error;
                        }
                        return;
                    }

                    if (Cache.Instance.InSpace)
                    {
                        Logging.Log(module, "Arrived at destination (in space, Questor stopped)", Logging.White);
                        Cache.Instance.Paused = true;
                        return;
                    }

                    Logging.Log(module, "Arrived at destination", Logging.White);
                    if (_States.CurrentCombatMissionBehaviorState == CombatMissionsBehaviorState.Traveler)
                    {
                        _States.CurrentCombatMissionBehaviorState = CombatMissionsBehaviorState.Idle;
                    }

                    if (_States.CurrentDedicatedBookmarkSalvagerBehaviorState == DedicatedBookmarkSalvagerBehaviorState.Traveler)
                    {
                        _States.CurrentDedicatedBookmarkSalvagerBehaviorState = DedicatedBookmarkSalvagerBehaviorState.Idle;
                    }

                    if (_States.CurrentCombatHelperBehaviorState == CombatHelperBehaviorState.Traveler)
                    {
                        _States.CurrentCombatHelperBehaviorState = CombatHelperBehaviorState.Idle;
                    }
                    return;
                }
            }
            return;
        }
Beispiel #8
0
        public static void TravelToAgentsStation(string module)
        {
            //
            // defending yourself is more important that the traveling part... so it comes first.
            //
            if (Cache.Instance.InSpace && Settings.Instance.DefendWhileTraveling)
            {
                if (!Cache.Instance.ActiveShip.Entity.IsCloaked || (Cache.Instance.LastSessionChange.AddSeconds(60) > DateTime.UtcNow))
                {
                    if (Settings.Instance.DebugGotobase)
                    {
                        Logging.Log(module, "TravelToAgentsStation: _combat.ProcessState()", Logging.White);
                    }
                    try
                    {
                        Combat.ProcessState();
                    }
                    catch (Exception exception)
                    {
                        Logging.Log("Travel.TravelToAgentsStation", "Exception [" + exception + "]", Logging.Debug);
                    }

                    if (!Cache.Instance.TargetedBy.Any(t => t.IsWarpScramblingMe))
                    {
                        if (Settings.Instance.DebugGotobase)
                        {
                            Logging.Log(module, "TravelToAgentsStation: we are not scrambled - pulling drones.", Logging.White);
                        }
                        Cache.Instance.IsMissionPocketDone = true; //tells drones.cs that we can pull drones

                        //Logging.Log("CombatmissionBehavior","TravelToAgentStation: not pointed",Logging.White);
                    }
                    else if (Cache.Instance.TargetedBy.Any(t => t.IsWarpScramblingMe))
                    {
                        Cache.Instance.IsMissionPocketDone = false;
                        if (Settings.Instance.DebugGotobase)
                        {
                            Logging.Log(module, "TravelToAgentsStation: we are scrambled", Logging.Teal);
                        }
                        Drones.ProcessState();
                        return;
                    }
                }
            }

            if (Settings.Instance.SpeedTank)
            {
                Cache.Instance.OpenWrecks = false;
            }

            if (Settings.Instance.DebugGotobase)
            {
                Logging.Log(module, "TravelToAgentsStation:      Cache.Instance.AgentStationId [" + Cache.Instance.AgentStationID + "]", Logging.White);
            }
            if (Settings.Instance.DebugGotobase)
            {
                Logging.Log(module, "TravelToAgentsStation:  Cache.Instance.AgentSolarSystemId [" + Cache.Instance.AgentSolarSystemID + "]", Logging.White);
            }

            if (_destination == null || _destination.SolarSystemId != Cache.Instance.AgentSolarSystemID)
            {
                Logging.Log(module, "Destination: [" + Cache.Instance.AgentStationName + "]", Logging.White);
                _destination = new StationDestination(Cache.Instance.AgentSolarSystemID, Cache.Instance.AgentStationID, Cache.Instance.AgentStationName);
                _States.CurrentTravelerState = TravelerState.Idle;
                return;
            }
            else
            {
                if (Settings.Instance.DebugGotobase)
                {
                    if (Traveler.Destination != null)
                    {
                        Logging.Log("CombatMissionsBehavior", "TravelToAgentsStation: Traveler.Destination.SolarSystemId [" + Traveler.Destination.SolarSystemId + "]", Logging.White);
                    }
                }
                Traveler.ProcessState();

                //we also assume you are connected during a manual set of questor into travel mode (safe assumption considering someone is at the kb)
                Cache.Instance.LastKnownGoodConnectedTime = DateTime.UtcNow;
                Cache.Instance.MyWalletBalance            = Cache.Instance.DirectEve.Me.Wealth;

                if (_States.CurrentTravelerState == TravelerState.AtDestination)
                {
                    if (_States.CurrentCombatMissionCtrlState == CombatMissionCtrlState.Error)
                    {
                        Logging.Log(module, "an error has occurred", Logging.White);
                        if (_States.CurrentCombatMissionBehaviorState == CombatMissionsBehaviorState.Traveler)
                        {
                            _States.CurrentCombatMissionBehaviorState = CombatMissionsBehaviorState.Error;
                        }
                        return;
                    }

                    if (Cache.Instance.InSpace)
                    {
                        Logging.Log(module, "Arrived at destination (in space, Questor stopped)", Logging.White);
                        Cache.Instance.Paused = true;
                        return;
                    }

                    if (Settings.Instance.DebugTraveler)
                    {
                        Logging.Log(module, "Arrived at destination", Logging.White);
                    }
                    if (_States.CurrentCombatMissionBehaviorState == CombatMissionsBehaviorState.Traveler)
                    {
                        _States.CurrentCombatMissionBehaviorState = CombatMissionsBehaviorState.Idle;
                        _lastPulse = DateTime.UtcNow;
                        return;
                    }

                    if (_States.CurrentDedicatedBookmarkSalvagerBehaviorState == DedicatedBookmarkSalvagerBehaviorState.Traveler)
                    {
                        _States.CurrentDedicatedBookmarkSalvagerBehaviorState = DedicatedBookmarkSalvagerBehaviorState.Idle;
                        _lastPulse = DateTime.UtcNow;
                        return;
                    }

                    if (_States.CurrentCombatHelperBehaviorState == CombatHelperBehaviorState.Traveler)
                    {
                        _States.CurrentCombatHelperBehaviorState = CombatHelperBehaviorState.Idle;
                        _lastPulse = DateTime.UtcNow;
                        return;
                    }
                    return;
                }
            }
            return;
        }