Exemplo n.º 1
0
        internal static void DoAllocations(this CustomAllocation allocation)
        {
            if (!Settings.GlobalEnabled)
            {
                return;
            }

            if (allocation.IsAllocationRunning)
            {
                return;
            }
            try
            {
                var originalInput = Main.Character.energyMagicPanel.energyMagicInput;

                allocation.IsAllocationRunning = true;

                if (Settings.ManageNGUDiff)
                {
                    allocation.SwapNGUDiff();
                }
                if (Settings.ManageGear)
                {
                    allocation.EquipGear();
                }
                if (Settings.ManageEnergy)
                {
                    allocation.AllocateEnergy();
                }
                if (Settings.ManageMagic)
                {
                    allocation.AllocateMagic();
                }
                if (Settings.ManageR3)
                {
                    allocation.AllocateR3();
                }

                if (Settings.ManageDiggers && Main.Character.buttons.diggers.interactable)
                {
                    allocation.EquipDiggers();
                    DiggerManager.RecapDiggers();
                }

                if (Settings.ManageWandoos && Main.Character.buttons.wandoos.interactable)
                {
                    allocation.SwapOS();
                }

                Main.Character.energyMagicPanel.energyRequested.text = originalInput.ToString();
                Main.Character.energyMagicPanel.validateInput();
            }
            finally
            {
                allocation.IsAllocationRunning = false;
            }
        }
Exemplo n.º 2
0
 internal static void LoadAllocation()
 {
     _profile = new CustomAllocation(_profilesDir, Settings.AllocationFile);
     try
     {
         _profile.ReloadAllocation();
     }
     catch (Exception e)
     {
         Log(e.Message);
     }
 }
Exemplo n.º 3
0
        public void Start()
        {
            _dir = Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%/Desktop"), "NGUInjector");
            if (!Directory.Exists(_dir))
            {
                Directory.CreateDirectory(_dir);
            }

            var logDir = Path.Combine(_dir, "logs");

            if (!Directory.Exists(logDir))
            {
                Directory.CreateDirectory(logDir);
            }
            OutputWriter = new StreamWriter(Path.Combine(logDir, "inject.log"))
            {
                AutoFlush = true
            };
            LootWriter = new StreamWriter(Path.Combine(logDir, "loot.log"))
            {
                AutoFlush = true
            };
            CombatWriter = new StreamWriter(Path.Combine(logDir, "combat.log"))
            {
                AutoFlush = true
            };
            AllocationWriter = new StreamWriter(Path.Combine(logDir, "allocation.log"))
            {
                AutoFlush = true
            };

            try
            {
                Character = FindObjectOfType <Character>();

                Log("Injected");
                LogLoot("Starting Loot Writer");
                LogCombat("Starting Combat Writer");
                LogAllocation("Started Allocation Writer");
                Controller       = Character.inventoryController;
                PlayerController = FindObjectOfType <PlayerController>();
                _invManager      = new InventoryManager();
                _yggManager      = new YggdrasilManager();
                _questManager    = new QuestManager();
                _combManager     = new CombatManager();
                LoadoutManager.ReleaseLock();
                DiggerManager.ReleaseLock();

                Settings = new SavedSettings(_dir);

                if (!Settings.LoadSettings())
                {
                    var temp = new SavedSettings(null)
                    {
                        PriorityBoosts        = new int[] { },
                        YggdrasilLoadout      = new int[] { },
                        SwapYggdrasilLoadouts = true,
                        HighestAKZone         = 0,
                        SwapTitanLoadouts     = true,
                        TitanLoadout          = new int[] { },
                        ManageDiggers         = true,
                        ManageYggdrasil       = true,
                        ManageEnergy          = true,
                        ManageMagic           = true,
                        ManageInventory       = true,
                        ManageGear            = true,
                        AutoConvertBoosts     = true,
                        SnipeZone             = 0,
                        FastCombat            = false,
                        PrecastBuffs          = true,
                        AutoFight             = false,
                        AutoQuest             = true,
                        AutoQuestITOPOD       = false,
                        AllowMajorQuests      = false,
                        GoldDropLoadout       = new int[] {},
                        AutoMoneyPit          = false,
                        AutoSpin              = false,
                        MoneyPitLoadout       = new int[] {},
                        AutoRebirth           = false,
                        ManageWandoos         = false,
                        InitialGoldZone       = -1,
                        MoneyPitThreshold     = 1e5,
                        NextGoldSwap          = false,
                        BoostBlacklist        = new int[] {},
                        GoldZone              = 0,
                        CombatMode            = 0,
                        RecoverHealth         = false,
                        SnipeBossOnly         = true,
                        AllowZoneFallback     = false,
                        QuestFastCombat       = true,
                        AbandonMinors         = false,
                        MinorAbandonThreshold = 30,
                        QuestCombatMode       = 0,
                        AutoBuyEM             = false,
                        AutoSpellSwap         = false,
                        CounterfeitThreshold  = 400,
                        SpaghettiThreshold    = 30,
                        BloodNumberThreshold  = 1e10,
                        BalanceCube           = true,
                        CombatEnabled         = false,
                        GlobalEnabled         = true,
                        QuickDiggers          = new int[] {},
                        QuickLoadout          = new int[] {},
                        UseButterMajor        = false,
                        ManualMinors          = false,
                        UseButterMinor        = false,
                        ActivateFruits        = true
                    };

                    Settings.MassUpdate(temp);

                    Log($"Created default settings");
                }
                settingsForm = new SettingsForm();

                _profile = new CustomAllocation(_dir);
                _profile.ReloadAllocation();

                ConfigWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "settings.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ConfigWatcher.Changed += (sender, args) =>
                {
                    if (IgnoreNextChange)
                    {
                        IgnoreNextChange = false;
                        return;
                    }
                    Settings.LoadSettings();
                    settingsForm.UpdateFromSettings(Settings);
                };

                AllocationWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "allocation.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                AllocationWatcher.Changed += (sender, args) => { LoadAllocation(); };

                Settings.SaveSettings();
                Settings.LoadSettings();

                settingsForm.UpdateFromSettings(Settings);
                settingsForm.Show();

                InvokeRepeating("AutomationRoutine", 0.0f, 10.0f);
                InvokeRepeating("SnipeZone", 0.0f, .1f);
                InvokeRepeating("MonitorLog", 0.0f, 1f);
                InvokeRepeating("QuickStuff", 0.0f, .5f);
            }
            catch (Exception e)
            {
                Log(e.Message);
                Log(e.StackTrace);
            }
        }
Exemplo n.º 4
0
 internal static void LoadAllocation()
 {
     _profile = new CustomAllocation(_profilesDir, Settings.AllocationFile);
     _profile.ReloadAllocation();
 }