Exemple #1
0
        public async Task <bool> RetainerCheck(RetainerInfo retainer)
        {
            if (RetainerSettings.Instance.ReassignVentures && retainer.Active && retainer.Job != ClassJobType.Adventurer)
            {
                if (retainer.VentureTask != 0)
                {
                    var now      = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
                    var timeLeft = retainer.VentureEndTimestamp - now;

                    if (timeLeft <= 0 && SpecialCurrencyManager.GetCurrencyCount(SpecialCurrency.Venture) > 2)
                    {
                        await RetainerHandleVentures();
                    }
                    else
                    {
                        Log($"Venture will be done at {RetainerInfo.UnixTimeStampToDateTime(retainer.VentureEndTimestamp)}");
                    }
                }
            }

            if (RetainerSettings.Instance.DepositFromPlayer)
            {
                await RetainerRoutine.DumpItems();
            }

            if (RetainerSettings.Instance.GetGil)
            {
                GetRetainerGil();
            }

            return(true);
        }
Exemple #2
0
        public static async Task <bool> RetainerCheckOnlyVenture(RetainerInfo retainer)
        {
            if (retainer.VentureTask != 0)
            {
                var now      = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
                var timeLeft = retainer.VentureEndTimestamp - now;

                if (timeLeft <= 0 && SpecialCurrencyManager.GetCurrencyCount(SpecialCurrency.Venture) > 2)
                {
                    await RetainerHandleVentures();
                }
                else
                {
                    Log($"Venture will be done at {RetainerInfo.UnixTimeStampToDateTime(retainer.VentureEndTimestamp)}");
                }
            }

            return(true);
        }
Exemple #3
0
        public async Task RetainerRun()
        {
            var bell = await GoToSummoningBell();

            if (bell == false)
            {
                LogCritical("No summoning bell near by");
                TreeRoot.Stop("Done playing with retainers");
                return;
            }

            await RetainerRoutine.ReadRetainers(RetainerCheck);

            await Coroutine.Sleep(1000);

            if (!RetainerSettings.Instance.Loop || !RetainerSettings.Instance.ReassignVentures)
            {
                LogCritical($"Loop Setting {RetainerSettings.Instance.Loop} ReassignVentures {RetainerSettings.Instance.ReassignVentures}");
                TreeRoot.Stop("Done playing with retainers");
            }

            if (RetainerSettings.Instance.Loop && InventoryManager.FreeSlots < 2)
            {
                LogCritical($"I am overburdened....free up some space you hoarder");
                TreeRoot.Stop("Done playing with retainers");
            }

            var count = await GetNumberOfRetainers();

            var rets = Core.Memory.ReadArray <RetainerInfo>(Offsets.RetainerData, count);

            if (!rets.Any(i => i.VentureTask != 0 && i.Active))
            {
                LogCritical($"No ventures assigned or completed");
                TreeRoot.Stop("Done playing with retainers");
            }

            var nextVenture = rets.Where(i => i.VentureTask != 0 && i.Active).OrderBy(i => i.VentureEndTimestamp).First();

            if (nextVenture.VentureEndTimestamp == 0)
            {
                LogCritical($"No ventures running");
                TreeRoot.Stop("Done playing with retainers");
            }

            if (SpecialCurrencyManager.GetCurrencyCount(SpecialCurrency.Venture) <= 2)
            {
                LogCritical($"Get more venture tokens...bum");
                TreeRoot.Stop("Done playing with retainers");
            }

            var now      = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
            var timeLeft = nextVenture.VentureEndTimestamp - now;

            Log($"Waiting till {RetainerInfo.UnixTimeStampToDateTime(nextVenture.VentureEndTimestamp)}");
            await Coroutine.Sleep(timeLeft * 1000);

            await Coroutine.Sleep(30000);

            Log($"{nextVenture.Name} Venture should be done");
        }