示例#1
0
        public void ProcessState()
        {
            // Nothing to salvage in stations
            //if (Cache.Instance.InStation)
            //    return;

            //var cargo = Cache.Instance.DirectEve.GetShipsCargo();
            switch (State)
            {
                case DebugModuleState.Debug_Windows:
                    Debug_Windows();

                    // Next state
                    State = DebugModuleState.Done;
                    break;

                //case DebugModuleState.LootHostileWrecks:
                //    LootHostileWrecks();
                //
                //    //State = DebugModuleState.SalvageHostileWrecks;
                //    break;
                //

                case DebugModuleState.Done:
                    // Wait indefinately...
                    break;

                case DebugModuleState.Error:
                    // Wait indefinately...
                    break;

                default:
                    // Unknown state, goto first state
                    State = DebugModuleState.Debug_Windows;
                    break;
            }
        }
示例#2
0
        public void ProcessState()
        {
            // Nothing to salvage in stations
            //if (Cache.Instance.InStation)
            //    return;

            //var cargo = Cache.Instance.DirectEve.GetShipsCargo();
            switch (State)
            {
            case DebugModuleState.Debug_Windows:
                Debug_Windows();

                // Next state
                State = DebugModuleState.Done;
                break;

            //case DebugModuleState.LootHostileWrecks:
            //    LootHostileWrecks();
            //
            //    //State = DebugModuleState.SalvageHostileWrecks;
            //    break;
            //

            case DebugModuleState.Done:
                // Wait indefinately...
                break;

            case DebugModuleState.Error:
                // Wait indefinately...
                break;

            default:
                // Unknown state, goto first state
                State = DebugModuleState.Debug_Windows;
                break;
            }
        }
示例#3
0
        public void ProcessState()
        {
            // Nothing to salvage in stations
            if (Cache.Instance.InStation)
                return;

            var cargo = Cache.Instance.DirectEve.GetShipsCargo();
            switch (State)
            {
                case DebugModuleState.TargetHostileWrecks:
                    //TargetHostileWrecks();

                    // Next state
                    State = ScoopState.LootHostileWrecks;
                    break;

                case DebugModuleState.LootHostileWrecks:
                    LootHostileWrecks();

                    //State = ScoopState.SalvageHostileWrecks;
                    break;

                case DebugModuleState.SalvageHostileWrecks:
                    ActivateSalvagers();

                    // Default action
                    State = ScoopState.TargetHostileWrecks;
                    //if (cargo.IsReady && cargo.Items.Any() && _nextAction < DateTime.UtcNow)
                    //{
                        // Check if there are actually duplicates
                    //    var duplicates = cargo.Items.Where(i => i.Quantity > 0).GroupBy(i => i.TypeId).Any(t => t.Count() > 1);
                    //    if (duplicates)
                    //        State = SalvageState.StackItems;
                    //    else
                    //        _nextAction = DateTime.UtcNow.AddSeconds(150);
                    //}
                    break;

                case DebugModuleState.StackItemsWhileAggressed:
                    Logging.Log("Salvage: Stacking items");

                    if (cargo.IsReady)
                        cargo.StackAll();

                    _nextAction = DateTime.UtcNow.AddSeconds(5);
                    State = ScoopState.WaitForStackingWhileAggressed;
                    break;

                case DebugModuleState.WaitForStackingWhileAggressed:
                    // Wait 5 seconds after stacking
                    if (_nextAction > DateTime.UtcNow)
                        break;

                    if (Cache.Instance.DirectEve.GetLockedItems().Count == 0)
                    {
                        Logging.Log("Salvage: Done stacking");
                        State = ScoopState.TargetHostileWrecks;
                        break;
                    }

                    if (DateTime.UtcNow.Subtract(_nextAction).TotalSeconds > 120)
                    {
                        Logging.Log("Salvage: Stacking items timed out, clearing item locks");
                        Cache.Instance.DirectEve.UnlockItems();

                        Logging.Log("Salvage: Done stacking");
                        State = ScoopState.TargetHostileWrecks;
                        break;
                    }
                    break;

                case DebugModuleState.Error:
                    // Wait indefinately...
                    break;

                default:
                    // Unknown state, goto first state
                    State = DebugModuleState.LootHostileWrecks;
                    break;
            }
        }
示例#4
0
        public void ProcessState()
        {
            // Nothing to salvage in stations
            if (Cache.Instance.InStation)
            {
                return;
            }

            var cargo = Cache.Instance.DirectEve.GetShipsCargo();

            switch (State)
            {
            case DebugModuleState.TargetHostileWrecks:
                //TargetHostileWrecks();

                // Next state
                State = ScoopState.LootHostileWrecks;
                break;

            case DebugModuleState.LootHostileWrecks:
                LootHostileWrecks();

                //State = ScoopState.SalvageHostileWrecks;
                break;

            case DebugModuleState.SalvageHostileWrecks:
                ActivateSalvagers();

                // Default action
                State = ScoopState.TargetHostileWrecks;
                //if (cargo.IsReady && cargo.Items.Any() && _nextAction < DateTime.UtcNow)
                //{
                // Check if there are actually duplicates
                //    var duplicates = cargo.Items.Where(i => i.Quantity > 0).GroupBy(i => i.TypeId).Any(t => t.Count() > 1);
                //    if (duplicates)
                //        State = SalvageState.StackItems;
                //    else
                //        _nextAction = DateTime.UtcNow.AddSeconds(150);
                //}
                break;

            case DebugModuleState.StackItemsWhileAggressed:
                Logging.Log("Salvage: Stacking items");

                if (cargo.IsReady)
                {
                    cargo.StackAll();
                }

                _nextAction = DateTime.UtcNow.AddSeconds(5);
                State       = ScoopState.WaitForStackingWhileAggressed;
                break;

            case DebugModuleState.WaitForStackingWhileAggressed:
                // Wait 5 seconds after stacking
                if (_nextAction > DateTime.UtcNow)
                {
                    break;
                }

                if (Cache.Instance.DirectEve.GetLockedItems().Count == 0)
                {
                    Logging.Log("Salvage: Done stacking");
                    State = ScoopState.TargetHostileWrecks;
                    break;
                }

                if (DateTime.UtcNow.Subtract(_nextAction).TotalSeconds > 120)
                {
                    Logging.Log("Salvage: Stacking items timed out, clearing item locks");
                    Cache.Instance.DirectEve.UnlockItems();

                    Logging.Log("Salvage: Done stacking");
                    State = ScoopState.TargetHostileWrecks;
                    break;
                }
                break;

            case DebugModuleState.Error:
                // Wait indefinately...
                break;

            default:
                // Unknown state, goto first state
                State = DebugModuleState.LootHostileWrecks;
                break;
            }
        }